From 146d03916e4959f7d4d89c416aaa7bc7f05bac59 Mon Sep 17 00:00:00 2001 From: 7YZ7 <82019212+7YZ7@users.noreply.github.com> Date: Sun, 23 Apr 2023 13:41:24 +0800 Subject: [PATCH] Update mqtt_iot_explorer_esp8266.c --- .../App/mqtt_iot_explorer_esp8266.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/board/TencentOS_Tiny_EVB_STM32WL/KEIL/lorawan_pm25/App/mqtt_iot_explorer_esp8266.c b/board/TencentOS_Tiny_EVB_STM32WL/KEIL/lorawan_pm25/App/mqtt_iot_explorer_esp8266.c index dcdec3da..664ac13f 100644 --- a/board/TencentOS_Tiny_EVB_STM32WL/KEIL/lorawan_pm25/App/mqtt_iot_explorer_esp8266.c +++ b/board/TencentOS_Tiny_EVB_STM32WL/KEIL/lorawan_pm25/App/mqtt_iot_explorer_esp8266.c @@ -65,7 +65,7 @@ void mqtt_demo_task(void) device_info_t dev_info; memset(&dev_info, 0, sizeof(device_info_t)); - char str[16]; + char str[32]; size_t mail_size; uint8_t report_error_count = 0; char client_token[10]; @@ -103,7 +103,7 @@ void mqtt_demo_task(void) tos_sleep_ms(5000); } - /* 开始订阅topic */ + /* 寮濮嬭闃卼opic */ size = snprintf(report_reply_topic_name, TOPIC_NAME_MAX_SIZE, "$thing/down/property/%s/%s", product_id, device_name); if (size < 0 || size > sizeof(report_reply_topic_name) - 1) { @@ -122,7 +122,7 @@ void mqtt_demo_task(void) printf("pub topic content length not enough! content size:%d buf size:%d", size, (int)sizeof(report_topic_name)); } - /* 创建邮箱 */ + /* 鍒涘缓閭 */ tos_mail_q_create(&mail_q, pm2d5_value_pool, 3, sizeof(pm2d5_data_u)); HAL_NVIC_DisableIRQ(USART2_IRQn); @@ -133,22 +133,22 @@ void mqtt_demo_task(void) } while (1) { - /* 通过接收邮件来读取数据 */ + /* 閫氳繃鎺ユ敹閭欢鏉ヨ鍙栨暟鎹 */ HAL_NVIC_EnableIRQ(USART2_IRQn); tos_mail_q_pend(&mail_q, (uint8_t*)&pm2d5_value, &mail_size, TOS_TIME_FOREVER); HAL_NVIC_DisableIRQ(USART2_IRQn); - //收到之后打印信息 + //鏀跺埌涔嬪悗鎵撳嵃淇℃伅 printf("\r\n\r\n\r\n"); for (i = 0; i < 13; i++) { printf("data[%d]:%d ug/m3\r\n", i+1, pm2d5_value.data[i]); } - /* 显示PM2.5的值 */ + /* 鏄剧ずPM2.5鐨勫 */ sprintf(str, "PM2.5:%4d ug/m3", pm2d5_value.pm2d5_data.data2); - OLED_ShowString(0,0,(uint8_t*)str,16); + OLED_ShowString(0,0,(uint8_t*)str,32); - /* 上报值 */ + /* 涓婃姤鍊 */ generate_client_token(client_token, sizeof(client_token)); memset(payload, 0, 1024); snprintf(payload, 1024, REPORT_DATA_TEMPLATE, client_token, @@ -183,7 +183,7 @@ void application_entry(void *arg) { char *str = "TencentOS-Tiny"; - /* 初始化OLED */ + /* 鍒濆鍖朞LED */ mqtt_demo_task(); while (1) {