An API for using MQTT over multiple transports

Dependencies:   FP MQTTPacket

Dependents:   Cellular_HelloMQTT IoTStarterKit GSwifiInterface_HelloMQTT IBMIoTClientEthernetExample ... more

This library is part of the EclipseTM Paho project; specifically the embedded client.

The goals of this API are:

  1. to be independent of any system library: hence templates parameters for networking, timer and threading classes
  2. not to rely on heap storage, only automatic (I think this is a good thing)
  3. to limit memory use, for instance by defining the size of the buffers and arrays used at object creation time
Revision:
37:e3d64f9b986c
Parent:
36:2f1ada427e56
Child:
40:9623a2c9c8ac
--- a/MQTTClient.h	Fri Aug 01 14:45:25 2014 +0000
+++ b/MQTTClient.h	Fri Aug 01 17:01:13 2014 +0000
@@ -53,9 +53,7 @@
 struct MessageData
 {
     MessageData(MQTTString &aTopicName, struct Message &aMessage)  : message(aMessage), topicName(aTopicName)
-    {
-
-    }
+    { }
     
     struct Message &message;
     MQTTString &topicName;
@@ -538,7 +536,8 @@
     if (waitfor(CONNACK, connect_timer) == CONNACK)
     {
         unsigned char connack_rc = 255;
-        if (MQTTDeserialize_connack(&connack_rc, readbuf, MAX_MQTT_PACKET_SIZE) == 1)
+        bool sessionPresent = false;
+        if (MQTTDeserialize_connack((unsigned char*)&sessionPresent, &connack_rc, readbuf, MAX_MQTT_PACKET_SIZE) == 1)
             rc = connack_rc;
         else
             rc = FAILURE;