MQTT Communication
Smart Factory
MQTTCommunication.cpp File Reference

Implementation of the Connection class. More...

Include dependency graph for MQTTCommunication.cpp:

Go to the source code of this file.

Functions

void callback (char *topic, byte *payload, unsigned int length)
 If the client is used to subscribe to topics, a callback function must be provided in the constructor. his function is called when new messages arrive at the client. More...
 

Variables

myJSON _myjson (MAX_JSON_PARSE_SIZE)
 instance of myJSON More...
 
CircularBuffer< myJSONStr, MAX_JSON_MESSAGES_SAVED_buffer
 instance of CircularBuffer More...
 

Detailed Description

Implementation of the Connection class.

Author
Luca Mazzoleni (luca..nosp@m.mazz.nosp@m.oleni.nosp@m.@hsr.nosp@m..ch)
Version
1.0 - added Connection-Implementation - Luca Mazzoleni (luca..nosp@m.mazz.nosp@m.oleni.nosp@m.@hsr.nosp@m..ch) - 2019-04-16
Date
2019-04-09

Definition in file MQTTCommunication.cpp.

Function Documentation

◆ callback()

void callback ( char *  topic,
byte *  payload,
unsigned int  length 
)

If the client is used to subscribe to topics, a callback function must be provided in the constructor. his function is called when new messages arrive at the client.

Todo:
Change global implementation of callback. Maybe with static?

Definition at line 32 of file MQTTCommunication.cpp.

Variable Documentation

◆ _buffer

CircularBuffer<myJSONStr, MAX_JSON_MESSAGES_SAVED> _buffer

instance of CircularBuffer

Declares a global Circular Buffer of type myJSONStr with max Elements of MAX_JSON_MESSAGES_SAVED.

Definition at line 26 of file MQTTCommunication.cpp.

◆ _myjson

instance of myJSON

Declare a global variable from typ myJSON so it can be accessed in callback.