EventMesh.subscribe("send_unbind_dev_to_iot",self.send_unbind_dev_to_iot)#心跳包定时器开启
self.reconnect_count = 0
self.deviceReadState = ""
+
# self.connect_timer.start(2000,0,self.iot_connect_timerCb)
def send_device_information(self,event,msg):
if stagecode == 3 and subcode == 1:
socket_log.info('Network connection successful!')
+ if sim.getStatus() != 1 or self.start_voice_flag == 1:#网络正常
+ return
+
if self.reconnect_count >= WEB_CONNECT_MAX_COUNT: #重连次数大于10次不在进重连只有下发心跳才重新连接
return
token = EventMesh.publish("get_dev_token")
# print("心跳发送数据包:{}".format(heart_packet))
def send_packet_iot(self,data):#发送数据给iot,data为接口json数据
+ if sim.getStatus() != 1 or self.start_voice_flag == 1:#网络正常
+ return
#Header
header = ustruct.pack('>H', 0xFFFE) # 使用大端模式
#Type
#日期
watchface1_date_span = lv.label(Watchface1)
-watchface1_date_span.set_pos(85, 191)
+watchface1_date_span.set_pos(70, 191)
watchface1_date_span.set_size(140, 50)
watchface1_date_span.set_align(lv.TEXT_ALIGN.LEFT)
watchface1_date_span.set_text("")