From 654b3135e0eda328884400b637b92956a089993b Mon Sep 17 00:00:00 2001 From: Supowang <54426333+Supowang1989@users.noreply.github.com> Date: Sun, 4 Apr 2021 20:29:22 +0800 Subject: [PATCH] Update mqtt_iot_explorer_tc_pm25_oled.c --- .../demo/mqtt_iot_explorer_tc_pm25_oled.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/board/TencentOS_tiny_EVB_G0/KEIL/mqtt_iot_explorer_tc_pm25/demo/mqtt_iot_explorer_tc_pm25_oled.c b/board/TencentOS_tiny_EVB_G0/KEIL/mqtt_iot_explorer_tc_pm25/demo/mqtt_iot_explorer_tc_pm25_oled.c index bfa9b349..bff3254f 100644 --- a/board/TencentOS_tiny_EVB_G0/KEIL/mqtt_iot_explorer_tc_pm25/demo/mqtt_iot_explorer_tc_pm25_oled.c +++ b/board/TencentOS_tiny_EVB_G0/KEIL/mqtt_iot_explorer_tc_pm25/demo/mqtt_iot_explorer_tc_pm25_oled.c @@ -54,7 +54,7 @@ void default_message_handler(mqtt_message_t* msg) printf("---------------------------------------------------------\r\n"); } -char payload[256] = {0}; +char payload[1024] = {0}; static char report_topic_name[TOPIC_NAME_MAX_SIZE] = {0}; static char report_reply_topic_name[TOPIC_NAME_MAX_SIZE] = {0}; @@ -174,8 +174,8 @@ void mqtt_demo_task(void) /* 上报值 */ generate_client_token(client_token, sizeof(client_token)); - memset(payload, 0, sizeof(payload)); - snprintf(payload, sizeof(payload), REPORT_DATA_TEMPLATE, client_token, + memset(payload, 0, 1024); + snprintf(payload, 1024, REPORT_DATA_TEMPLATE, client_token, pm2d5_value.pm2d5_data.data1, pm2d5_value.pm2d5_data.data2, pm2d5_value.pm2d5_data.data3, pm2d5_value.pm2d5_data.data4, pm2d5_value.pm2d5_data.data5, pm2d5_value.pm2d5_data.data6,