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

Files at this revision

API Documentation at this revision

Comitter:
icraggs
Date:
Fri Aug 01 12:52:50 2014 +0000
Parent:
31:a51dd239b78e
Child:
40:9623a2c9c8ac
Commit message:
Change boolean field sizes in MQTTPacket to 1 char

Changed in this revision

FP.lib Show annotated file Show diff for this revision Revisions of this file
MQTTClient.h Show annotated file Show diff for this revision Revisions of this file
MQTTPacket.lib Show annotated file Show diff for this revision Revisions of this file
--- a/FP.lib	Thu May 22 23:58:08 2014 +0000
+++ b/FP.lib	Fri Aug 01 12:52:50 2014 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/sam_grove/code/FP/#e0f19cdaa46e
+http://mbed.org/users/sam_grove/code/FP/#3c62ba1807ac
--- a/MQTTClient.h	Thu May 22 23:58:08 2014 +0000
+++ b/MQTTClient.h	Fri Aug 01 12:52:50 2014 +0000
@@ -27,7 +27,7 @@
 #if !defined(MQTTCLIENT_H)
 #define MQTTCLIENT_H
 
-#include "FP.cpp"
+#include "FP.h"
 #include "MQTTPacket.h"
 #include "stdio.h"
 
@@ -419,7 +419,7 @@
         case PUBLISH:
             MQTTString topicName;
             Message msg;
-            if (MQTTDeserialize_publish((int*)&msg.dup, (int*)&msg.qos, (int*)&msg.retained, (int*)&msg.id, &topicName,
+            if (MQTTDeserialize_publish((unsigned char*)&msg.dup, (int*)&msg.qos, (unsigned char*)&msg.retained, (int*)&msg.id, &topicName,
                                  (char**)&msg.payload, (int*)&msg.payloadlen, readbuf, MAX_MQTT_PACKET_SIZE) != 1)
                 goto exit;
 //          if (msg.qos != QOS2) 
@@ -446,7 +446,8 @@
             }
             break;
         case PUBREC:
-            int type, dup, mypacketid;
+            int type, mypacketid;
+            unsigned char dup;
             if (MQTTDeserialize_ack(&type, &dup, &mypacketid, readbuf, MAX_MQTT_PACKET_SIZE) != 1)
                 rc = FAILURE;
             else if ((len = MQTTSerialize_ack(buf, MAX_MQTT_PACKET_SIZE, PUBREL, 0, mypacketid)) <= 0)
@@ -654,7 +655,8 @@
     {
         if (waitfor(PUBACK, timer) == PUBACK)
         {
-            int type, dup, mypacketid;
+            int type, mypacketid;
+            unsigned char dup;
             if (MQTTDeserialize_ack(&type, &dup, &mypacketid, readbuf, MAX_MQTT_PACKET_SIZE) != 1)
                 rc = FAILURE;
         }
@@ -665,7 +667,8 @@
     {
         if (waitfor(PUBCOMP, timer) == PUBCOMP)
         {
-            int type, dup, mypacketid;
+            int type, mypacketid;
+            unsigned char dup;
             if (MQTTDeserialize_ack(&type, &dup, &mypacketid, readbuf, MAX_MQTT_PACKET_SIZE) != 1)
                 rc = FAILURE;
         }
--- a/MQTTPacket.lib	Thu May 22 23:58:08 2014 +0000
+++ b/MQTTPacket.lib	Fri Aug 01 12:52:50 2014 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/teams/mqtt/code/MQTTPacket/#3893bc7343f4
+http://mbed.org/teams/mqtt/code/MQTTPacket/#5e60cd1a52e7