iot_water_monitor_v2
Dependencies: easy-connect-v16 Watchdog FP MQTTPacket RecordType-v-16 watersenor_and_temp_code
Diff: Simple-MQTT/SimpleMQTT.h
- Revision:
- 48:a7ed665844cd
- Parent:
- 47:c3707a4f69a7
- Child:
- 50:5a19fc4b41d9
--- a/Simple-MQTT/SimpleMQTT.h Thu Mar 08 14:19:48 2018 +0000 +++ b/Simple-MQTT/SimpleMQTT.h Thu Mar 08 16:38:35 2018 +0000 @@ -397,7 +397,7 @@ } // strftime(timeBuf, 50, "%Y/%m/%d %H:%M:%S", localtime(&inputTime)); - sprintf(buf, "{\"type\":2,\"deviceId\":\"PROEVN\",\"time\":\"%d\",\"cmdId\":%d,\"temperature0\":%.2f,\"oxygen0\":%.2f}", + sprintf(buf, "{\"type\":2,\"deviceId\":\"PROEVN\",\"time\":%d,\"cmdId\":%d,\"temperature0\":%.2f,\"oxygen0\":%.2f}", inputTime, commandID, TempVal ,DOVal); message.qos = MQTT::QOS0; message.retained = false; @@ -423,7 +423,7 @@ return MQTT::FAILURE; } // strftime(timeBuf, 50, "%Y/%m/%d %H:%M:%S", localtime(&inputTime)); - sprintf(buf, "{\"type\":3,\"deviceId\":\"PROEVN\",\"time\":\"%s\",\"cmdId\":%d,\"relay1\":%d,\"relay2\":%d,\"relay3\":%d}", + sprintf(buf, "{\"type\":3,\"deviceId\":\"PROEVN\",\"time\":%d,\"cmdId\":%d,\"relay1\":%d,\"relay2\":%d,\"relay3\":%d}", inputTime, commandID, relay1, relay2, relay3); message.qos = MQTT::QOS0; message.retained = false; @@ -450,7 +450,7 @@ return MQTT::FAILURE; } // strftime(timeBuf, 50, "%Y/%m/%d %H:%M:%S", localtime(&inputTime)); - sprintf(buf, "{\"type\":4,\"deviceId\":\"PROEVN\",\"time\":\"%s\",\"cmdId\":%d,\"mode\":%d,\"OxygenThreshold\":%d,\"TemperatureThreshold\":%d,\"uploadInterval\":%d}", + sprintf(buf, "{\"type\":4,\"deviceId\":\"PROEVN\",\"time\":%d,\"cmdId\":%d,\"mode\":%d,\"OxygenThreshold\":%d,\"TemperatureThreshold\":%d,\"uploadInterval\":%d}", inputTime, commandID, mode, OxyThreshold, TemperatureThreshold, UploadInterval); message.qos = MQTT::QOS0; message.retained = false;