Initial port of the Arduino MQTT Client: http://knolleary.net/arduino-client-for-mqtt/ Updated with larger timeout and buffer sizes

Dependents:   mbed_mqtt_endpoint_ublox_ethernet mbed_mqtt_endpoint_ublox_cellular mbed_mqtt_endpoint_nxp

Fork of MQTT by Joerg Wende

Revision:
7:9e005abd6846
Parent:
0:ca855d29545b
Child:
8:40326dd71c95
diff -r f8294e112608 -r 9e005abd6846 PubSubClient.cpp
--- a/PubSubClient.cpp	Tue Apr 01 20:06:21 2014 +0000
+++ b/PubSubClient.cpp	Mon Apr 07 03:14:47 2014 +0000
@@ -11,7 +11,7 @@
 #include "PubSubClient.h"
 
 Timer t;
-//Serial pc1(USBTX, USBRX);
+Serial pc1(USBTX, USBRX);
 
 
 int millis()
@@ -53,9 +53,9 @@
         int result = 0;
         result = _client.connect(this->ip, this->port);
         _client.set_blocking(false, 1);
-        //pc1.printf("IP: %s\r\n",this->ip);
-        //pc1.printf("Port: %i\r\n",this->port);
-        //pc1.printf("Result: %i \r\n", result);
+        pc1.printf("IP: %s\r\n",this->ip);
+        pc1.printf("Port: %i\r\n",this->port);
+        pc1.printf("Result: %i \r\n", result);
 
         if (result==0) {
             nextMsgId = 1;
@@ -98,7 +98,7 @@
                     length = writeString(pass,buffer,length);
                 }
             }
-            //pc1.printf("Before MQTT Connect ... \r\n");
+            pc1.printf("Before MQTT Connect ... \r\n");
             write(MQTTCONNECT,buffer,length-5);
 
             lastInActivity = lastOutActivity = millis();
@@ -113,7 +113,7 @@
                     return false;
                 }
             }
-            //pc1.printf("after MQTT Connect ... %i\r\n",len);
+            pc1.printf("after MQTT Connect ... %i\r\n",len);
             if (len == 4 && buffer[3] == 0) {
                 lastInActivity = millis();
                 pingOutstanding = false;