From 19ab97f32f182a8917f88f03a70d72bc8d86b5b3 Mon Sep 17 00:00:00 2001 From: mculover666 <2412828003@qq.com> Date: Sun, 30 Aug 2020 11:30:24 +0800 Subject: [PATCH] fix a bug in mqttclient_iot_explorer example --- .../mqttclient_iot_explorer/mqttclient_iot_explorer.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/mqttclient_iot_explorer/mqttclient_iot_explorer.c b/examples/mqttclient_iot_explorer/mqttclient_iot_explorer.c index 6b1bf93f..0239b787 100644 --- a/examples/mqttclient_iot_explorer/mqttclient_iot_explorer.c +++ b/examples/mqttclient_iot_explorer/mqttclient_iot_explorer.c @@ -5,10 +5,10 @@ #include "cjson.h" #include "sal_module_wrapper.h" -#define USE_ESP8266 +//#define USE_ESP8266 //#define USE_NB_BC35 //#define USE_BC26 -//#define USE_EC200S +#define USE_EC200S #if defined(USE_ESP8266) #include "esp8266.h" @@ -147,6 +147,10 @@ void mqttclient_task(void) memset(&msg, 0, sizeof(msg)); snprintf(report_buf, sizeof(report_buf), REPORT_DATA_TEMPLATE, lightness++); + + if (lightness > 100) { + lightness = 0; + } msg.qos = QOS0; msg.payload = (void *) report_buf;