17 #ifndef ROVERAPI_ROVER_PAHOMQTT_HPP_ 18 #define ROVERAPI_ROVER_PAHOMQTT_HPP_ 25 #include "MQTTClient.h" 26 #include "MQTTAsync.h" 119 MQTTAsync client = NULL;
144 void createClient(
void);
149 void destroyClient(
void);
173 void setHostName (
char * host_name);
179 void setPort (
const int port);
186 void setPayload (
const char * payload,
int payloadLen);
192 void setTopic (
char * topic);
199 int read (
char * data);
204 int isDataReady (
void);
243 int subscribe (
void);
256 int unsubscribe (
void);
262 int getConnected(
void);
269 void flushFlags (
void);
275 void constructAddress (
void);
285 static void onConnect_Redirect (
void* context, MQTTAsync_successData* response);
293 static void onPublisherSend_Redirect (
void* context, MQTTAsync_successData* response);
300 void onConnect (MQTTAsync_successData* response);
308 void onPublisherSend (MQTTAsync_successData* response);
320 static int onSubscriberMessageArrived_Redirect (
void *context,
char *topicName,
int topicLen, MQTTAsync_message *message);
328 static void onSubscribe_Redirect (
void* context, MQTTAsync_successData* response);
336 static void onSubscribeFailure_Redirect (
void* context, MQTTAsync_failureData* response);
346 int onSubscriberMessageArrived (
char *topicName,
int topicLen, MQTTAsync_message *message);
353 void onSubscribe (MQTTAsync_successData* response);
360 void onSubscribeFailure (MQTTAsync_failureData* response);
369 static void onConnectFailure_Redirect (
void* context, MQTTAsync_failureData* response);
377 static void onConnectionLost_Redirect (
void* context,
char *cause);
384 void onConnectFailure (MQTTAsync_failureData* response);
392 static void onDisconnect_Redirect (
void* context, MQTTAsync_successData* response);
399 void onConnectionLost (
char *cause);
406 void onDisconnect (MQTTAsync_successData* response);
417 char my_address[100] = {};
int f_mqtt_subscribed
Definition: rover_pahomqtt.hpp:63
char * HOST_NAME
Host name used for connecting to the Eclipse Paho MQTT server.
Definition: rover_pahomqtt.hpp:89
RoverMQTT_StatusFlags_t defaultRoverMQTTFlags
Member attribute for flags.
Definition: rover_pahomqtt.hpp:109
int f_mqtt_publish_successful
Definition: rover_pahomqtt.hpp:64
Data type to store internal flags for MQTT communication.
Definition: rover_pahomqtt.hpp:59
RoverPahoMQTT contains member functions to use rover as a client and to publish / subscribe to Eclips...
Definition: rover_pahomqtt.hpp:83
RoverMQTT_ReturnCodes_t defaultReturnCodes
Member attribute for return codes.
Definition: rover_pahomqtt.hpp:114
int data_ready
Definition: rover_pahomqtt.hpp:52
RoverMQTT_SubscribeData_t defaultRoverSubscribeData
Member attribute for subscribed data.
Definition: rover_pahomqtt.hpp:99
int rc_publish
Definition: rover_pahomqtt.hpp:73
rover Namespace contains classes to manage Rover sensors, gpio, buzzer, buttons, driving, utilities, and cloud.
Definition: rover_api.hpp:293
int f_mqtt_connected
Definition: rover_pahomqtt.hpp:65
MQTTAsync_connectOptions conn_opts
Connect options.
Definition: rover_pahomqtt.hpp:129
RoverCloud defines the interfaces that can be used for classes that connect to a remote cloud server...
Definition: rover_cloud.hpp:25
MQTTAsync_disconnectOptions disc_opts
Disconnect options.
Definition: rover_pahomqtt.hpp:134
int rc_unsubscribe
Definition: rover_pahomqtt.hpp:75
int rc_subscribe
Definition: rover_pahomqtt.hpp:74
char * data
Definition: rover_pahomqtt.hpp:53
int f_mqtt_finished
Definition: rover_pahomqtt.hpp:62
volatile MQTTAsync_token deliveredtoken
Delivered token.
Definition: rover_pahomqtt.hpp:139
Data type to store return codes that belong to member functions in RoverPahoMQTT class.
Definition: rover_pahomqtt.hpp:71
RoverMQTT_Configure_t defaultRoverMQTTConfigure
Member attribute for configuration data.
Definition: rover_pahomqtt.hpp:104
int f_mqtt_disconnect_finished
Definition: rover_pahomqtt.hpp:61
MQTTClient client2
Client object from MQTTClient.
Definition: rover_pahomqtt.hpp:124
Data type to store subscribed data.
Definition: rover_pahomqtt.hpp:50
int PORT
Port used for connecting to the Eclipse Paho MQTT server.
Definition: rover_pahomqtt.hpp:94