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:
9:01b8cc7d94cc
Parent:
8:c46930bd6c82
Child:
11:db15da110a37
Child:
12:cc7f2d62a393
--- a/MQTTClient.cpp	Wed Apr 09 13:48:20 2014 +0000
+++ b/MQTTClient.cpp	Wed Apr 09 23:21:54 2014 +0000
@@ -23,3 +23,13 @@
    ((Client<Network, Timer, Thread>*) arg)->run(NULL);
 }
 
+
+MQTT::PacketId::PacketId()
+{
+	next = 0;
+}
+
+int MQTT::PacketId::getNext()
+{
+    return next = (next == MAX_PACKET_ID) ? 1 : ++next;
+}
\ No newline at end of file