bugfix ota message format
This commit is contained in:
parent
fdd5dc370a
commit
164bbdb6e4
|
@ -23,11 +23,11 @@
|
|||
#include "uiot_import.h"
|
||||
#include "uiot_export_ota.h"
|
||||
|
||||
#define UIOT_MY_PRODUCT_SN "productSN"
|
||||
#define UIOT_MY_PRODUCT_SN "PRODUCT_SN"
|
||||
|
||||
#define UIOT_MY_DEVICE_SN "deviceSN"
|
||||
#define UIOT_MY_DEVICE_SN "DEVICE_SN"
|
||||
|
||||
#define UIOT_MY_DEVICE_SECRET "device_secret"
|
||||
#define UIOT_MY_DEVICE_SECRET "DEVICE_SECRET"
|
||||
|
||||
#define OTA_BUF_LEN (1024)
|
||||
|
||||
|
@ -113,7 +113,11 @@ int main(int argc, char **argv)
|
|||
LOG_ERROR("init OTA failed");
|
||||
return FAILURE_RET;
|
||||
}
|
||||
|
||||
|
||||
//report current version
|
||||
IOT_OTA_ReportVersion(h_ota, "default", "1.0.0");
|
||||
|
||||
|
||||
while(1)
|
||||
{
|
||||
IOT_MQTT_Yield(client, 5000);
|
||||
|
|
|
@ -32,9 +32,9 @@ extern "C" {
|
|||
|
||||
#define REPORT_VER_TEMPLATE "{\"Method\": \"report\", \"Payload\":{\"Module\":\"%s\", \"Version\":\"%s\"}}"
|
||||
#define REPORT_SUCCESS_MSG_TEMPLATE "{\"Method\": \"success\", \"Payload\": {\"TaskID\": \"%s\"}}"
|
||||
#define REPORT_FAIL_MSG_TEMPLATE "{\"Method\": \"fail\", \"Payload\": {\"TaskID\": %d, \"ErrMsg\":\"%s\"}}"
|
||||
#define NOTIFY_MSG_TEMPLATE "{\"Method\": \"notify\", \"Payload\":{\"TaskID\":%d}}"
|
||||
#define UPGRADING_MSG_TEMPLATE "{\"Method\": \"upgrading\", \"Payload\":{\"TaskID\":%d}}"
|
||||
#define REPORT_FAIL_MSG_TEMPLATE "{\"Method\": \"fail\", \"Payload\": {\"TaskID\": \"%s\", \"ErrMsg\":\"%s\"}}"
|
||||
#define NOTIFY_MSG_TEMPLATE "{\"Method\": \"notify\", \"Payload\":{\"TaskID\":\"%s\"}}"
|
||||
#define UPGRADING_MSG_TEMPLATE "{\"Method\": \"upgrading\", \"Payload\":{\"TaskID\":\"%s\"}}"
|
||||
|
||||
#define OTA_UPSTREAM_MSG_BUF_LEN (129)
|
||||
#define OTA_TOPIC_BUF_LEN (129)
|
||||
|
|
Loading…
Reference in New Issue