self.VC_taskid = ""
self.VC_server = 2 #0柒牌正式服务器,1:测试服务器1,2:测试服务器2
-
+ EventMesh.publish("connect_iot_socket")#连接IOT
+ print("IOT连接成功")
+ EventMesh.publish("login_IOT")#登录IOT
+ EventMesh.publish("send_unbind_dev_to_iot")#开启IOT心跳包
self.server_ip = EventMesh.publish("get_storage_config","server_ip")#
if self.server_ip == None:
if self.VC_server == 1:#
self.session_id = ""
self.draw_result = 0#抽签结果
+ self.dmp_update()#dmp初始化推送
EventMesh.subscribe("AI_key_press", self.AI_key_press)
EventMesh.subscribe("AI_key_double_press", self.AI_key_double_press)
EventMesh.subscribe("AI_key_release", self.AI_key_release)
usys.print_exception(e)
import protocol as pro
try:
- app.append_manager(pro.IOT_socket_SendCmdManager())
- pcr = pro.ProtoColResolver()
- pcr.add_support(pro.IOT_post_device_stateProtoCol())
- pcr.add_support(pro.IOT_FindDeviceProtoCol())
- # pcr.add_support(pro.IOTWeb_alarm_configProtoCol())
- # pcr.add_support(pro.IOTWeb_alarm_listProtoCol())
- sm = pro.SockMangager()
-
- sm.add_support_resolver(pcr)
+ app.append_manager(pro.IOT_socket_SendCmdManager())#IOT发送信息的类
+ sm = pro.SockMangager()#负责socket连接iot部分的代码以及事件订阅
app.append_manager(sm)
print("init_IOT.0:{}".format(utime.localtime()))
app.append_manager(_ai.AI_VC())
except Exception as e:
usys.print_exception(e)
- try:
- EventMesh.publish("dmp_update")#dmp推送
- except Exception as e:
- usys.print_exception(e)
- try:
- EventMesh.publish("connect_iot_socket")#连接IOT
- print("IOT连接成功")
- except Exception as e:
- usys.print_exception(e)
- try:
- EventMesh.publish("login_IOT")#登录IOT
- EventMesh.publish("send_unbind_dev_to_iot")#开启IOT心跳包
- except Exception as e:
- usys.print_exception(e)
+
except Exception as e:
usys.print_exception(e)