问题描述:
我用MQTTClient.check_msg()函数会导致网络重连,LOG如下:
WARN:MQTT:[2021-8-4 17:41:5] wait msg, Network exception. Trying to reconnect
INFO:MQTT:[2021-8-4 17:41:5] The network condition has been restored and an attempt will be made to reconnect
INFO:MQTT:[2021-8-4 17:41:6] Reconnection successful!
如果我创建一个线程,用MQTTClient.wait_msg()函数就没有问题,但是我有个疑问,这个函数是阻塞等待的,会sleep吗?会影响我低功耗吗?
还有另外一个问题关于低功耗的,例如我sleep 5秒, 这期间串口有数据收发,会等到5秒结束后再处理还是sleep立即返回?