Sample code that showcases how to use IBMIoTF client library to connect the mbed LPC1768 or FRDM-K64F devices to the IBM Internet of Things Cloud service.
Dependencies: C12832 IBMIoTF LM75B MMA7660
Revision 5:48b6090e0df1, committed 2017-05-31
- Comitter:
- lokeshhk
- Date:
- Wed May 31 10:03:52 2017 +0000
- Parent:
- 4:a416fef97faa
- Commit message:
- Enabled sending real device events back
Changed in this revision
src/Main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r a416fef97faa -r 48b6090e0df1 src/Main.cpp --- a/src/Main.cpp Tue May 30 06:59:13 2017 +0000 +++ b/src/Main.cpp Wed May 31 10:03:52 2017 +0000 @@ -86,16 +86,7 @@ int count = 0; sprintf(buf,"{\"d\":{\"myName\":\"IoT mbed\"}}"); - //Comment below stmts when sending real device events in following section - while(1){ - client->publishEvent("blink", buf); - client->yield(1); - if(!client->isConnected()) - break; - } - - //Uncomment the below commented section to send real device events - /*while(1) { + while(1) { if (++count == 100) { logMessage("\r\n"); @@ -126,7 +117,7 @@ led2 = !led2; client->yield(10); // allow the MQTT client to receive messages - }*/ + } if(client->isConnected()){ logMessage("Disconnecting the client from server...\r\n");