Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of MQTT by
Diff: MQTTClient.h
- Revision:
- 45:bd3567993b26
- Parent:
- 44:c299463ae853
diff -r c299463ae853 -r bd3567993b26 MQTTClient.h
--- a/MQTTClient.h Mon Oct 06 11:41:05 2014 +0000
+++ b/MQTTClient.h Wed Aug 12 02:38:46 2015 +0000
@@ -88,7 +88,7 @@
* @param Network a network class which supports send, receive
* @param Timer a timer class with the methods:
*/
-template<class Network, class Timer, int MAX_MQTT_PACKET_SIZE = 100, int MAX_MESSAGE_HANDLERS = 5>
+template<class Network, class Timer, int MAX_MQTT_PACKET_SIZE = ADV_MAX_PACKET_SIZE, int MAX_MESSAGE_HANDLERS = 5>
class Client
{
@@ -804,6 +804,7 @@
template<class Network, class Timer, int MAX_MQTT_PACKET_SIZE, int b>
int MQTT::Client<Network, Timer, MAX_MQTT_PACKET_SIZE, b>::publish(const char* topicName, void* payload, size_t payloadlen, unsigned short& id, enum QoS qos, bool retained)
{
+ printf("eric 1\n");
int rc = FAILURE;
Timer timer = Timer(command_timeout_ms);
MQTTString topicString = MQTTString_initializer;
@@ -818,9 +819,10 @@
if (qos == QOS1 || qos == QOS2)
id = packetid.getNext();
#endif
-
+printf("eric 2\n");
len = MQTTSerialize_publish(sendbuf, MAX_MQTT_PACKET_SIZE, 0, qos, retained, id,
topicString, (unsigned char*)payload, payloadlen);
+ printf("eric 3 len=%d\n",len);
if (len <= 0)
goto exit;
@@ -845,7 +847,7 @@
template<class Network, class Timer, int MAX_MQTT_PACKET_SIZE, int b>
int MQTT::Client<Network, Timer, MAX_MQTT_PACKET_SIZE, b>::publish(const char* topicName, void* payload, size_t payloadlen, enum QoS qos, bool retained)
-{
+{
unsigned short id = 0; // dummy - not used for anything
return publish(topicName, payload, payloadlen, id, qos, retained);
}
