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.
Dependencies: easy-connect-v16 Watchdog FP MQTTPacket RecordType-v-16 watersenor_and_temp_code
Revision 6:3efc470a9f35, committed 2017-11-28
- Comitter:
- DuyLionTran
- Date:
- Tue Nov 28 14:32:53 2017 +0000
- Parent:
- 5:7f353f2b63b9
- Child:
- 7:6fa70270f05f
- Commit message:
- version 1.0
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Tue Nov 28 13:47:02 2017 +0000
+++ b/main.cpp Tue Nov 28 14:32:53 2017 +0000
@@ -103,8 +103,7 @@
logMessage("rc from MQTT connect is %d\r\n", rc);
if ((rc = client.subscribe(topicCMD, MQTT::QOS0, messageArrived)) != 0)
logMessage("rc from MQTT subscribe is %d\r\n", rc);
-
-// char* payload = "{\"d\":{\"Name\":\"PROEVN\",\"Firmware Version\":\"0.86\"}}";
+
char greetingMessage[100];
sprintf(greetingMessage, "{\"d\":{\"Device ID\":\"PROEVN\",\"Firmware Version\":\"%f\"}}", firmwareVersion);
@@ -120,8 +119,6 @@
wait(2);
-// thread.start(callback(clientYield));
-// timer.attach(&publish, 2);
uint8_t counter = 0;
uint16_t cmdID = 0;
@@ -152,15 +149,12 @@
* Unity function declarations
***************************************************************/
int MQTT_publish(char *sendMessage) {
-
MQTT::Message msg;
msg.qos = MQTT::QOS0;
msg.retained = false;
msg.dup = false;
msg.payload = sendMessage;
msg.payloadlen = strlen(sendMessage) + 1;
-
- return client.publish(topicEvent, msg);
-
+ return client.publish(topicEvent, msg);
}