Local copy

Dependencies:   C12832_lcd ConfigFile EthernetInterface LM75B MMA7660 MQTTPacket mbed-rtos mbed

Fork of IBMIoTClientExampleForLPC1768 by Sam Danbury

Revision:
9:cbabd85f2d5d
Parent:
8:e58e10ca4352
Child:
12:e9ff8869a99d
--- a/src/QuickstartClient.cpp	Tue Jul 01 10:08:39 2014 +0000
+++ b/src/QuickstartClient.cpp	Tue Jul 01 19:10:47 2014 +0000
@@ -197,7 +197,7 @@
     }
 }
 
-void QuickstartClient::subscribe() {
+int QuickstartClient::subscribe() {
     int  rc = 0;
     int  len = 0;
     char buf[250];
@@ -208,7 +208,7 @@
     topicString.cstring = subscribeTopic;
 
     //Attempt MQTT subscribe
-    len = MQTTSerialize_subscribe(buf, buflen, 0, 11, 1, &topicString, 0);
+    len = MQTTSerialize_subscribe(buf, buflen, 0, 1, 1, &topicString, 0);
     rc = 0;
     while (rc < len) {
         int rc1 = mysock.send(buf, len);
@@ -220,15 +220,5 @@
         }
     }
     wait(0.2);
-    
-   /* if (MQTTPacket_read(buf, buflen, getdata) == SUBACK)
-    {
-        lcd.printf("SUBACK");
-    }*/
+    return rc;
 }
-/*
-int getdata(char* buf, size_t count)
-{
-    return recv(mysock, buf, (size_t)count, 0);
-}*/
-