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:
7:f9d690fb6dad
Parent:
6:4d312a49200b
Child:
8:c46930bd6c82
--- a/MQTTClient.cpp	Tue Apr 08 22:54:37 2014 +0000
+++ b/MQTTClient.cpp	Wed Apr 09 11:37:28 2014 +0100
@@ -21,8 +21,8 @@
 {
     
    buf = new char[buffer_size];
-   readbuf = new char[buffer_size];
-   this->ipstack = ipstack;
+   readbuf = new char[buffer_size];
+   buflen = readbuflen = buffer_size;
    this->command_timeout = command_timeout;
    //this->thread = new Thread(0); // only need a background thread for non-blocking mode
    this->ipstack = network;
@@ -153,7 +153,8 @@
 	}
 	
 	this->keepalive = options->keepAliveInterval;
-	len = MQTTSerialize_connect(buf, buflen, options);
+	len = MQTTSerialize_connect(buf, buflen, options);
+	printf("len from send is %d %d\n", len, buflen);
     rc = sendPacket(len); // send the connect packet
 	printf("rc from send is %d\n", rc);
     
@@ -205,4 +206,4 @@
     }
 	
 	return rc;
-}
\ No newline at end of file
+}