EventMesh.debug_log("voice_callback:on_list_flag{}".format(on_list_flag))
if on_list_flag == 1:#在白名单里
if WLKEY == "2":
+ WL_timer.stop()
WL_timer.start(30000, 0, WL_timer_cb)
else:
EventMesh.debug_log("voice_callback:不在白名单中,挂断")
if get_temp_state > 1 and (WEAR != 1 or call_state != 0):
EventMesh.publish(constants.EVENT.STOP_TEMP)
- EventMesh.publish("set_temp_state",0)
+ EventMesh.publish("set_temp_state",0)
EventMesh.txt_log("auto stop_temp:22")
if (self.get_hr_state > 1 or self.get_spo2_state > 1 or get_bp_state > 1 or get_bg_state > 1) and (WEAR != 1 or call_state != 0):
EventMesh.publish(constants.PROTOCOL.OXYGEN_SEND,spo2_value)
if get_bp_state > 1:
-
EventMesh.txt_log("auto stop_bp:22")
EventMesh.publish("set_bp_state",0)#2代表后台进入测试
EventMesh.publish(constants.EVENT.STOP_HEART)
if get_bg_state > 1:
EventMesh.txt_log("auto stop_bg:22")
-
EventMesh.publish("set_bg_state",0)#2代表后台进入测试
EventMesh.publish(constants.EVENT.STOP_HEART)
if WEAR == 1:
EventMesh.publish(constants.PROTOCOL.TEMP_SEND,[tmp_f_tmp,tmp_d_tmp])
EventMesh.publish(constants.EVENT.STOP_TEMP)
EventMesh.txt_log("auto start_temp:333")
+ else:
+ self.temp_one_state = 0
EventMesh.txt_log("auto START_temp:1")
EventMesh.publish(constants.EVENT.START_TEMP)
- elif (time_tmp-self.temp_timeSecond) >= 30 and self.temp_state == 1:
+ elif (time_tmp-self.temp_timeSecond) >= 30 and self.temp_state == 1 and get_temp_state == 2:
self.temp_state = 0
EventMesh.txt_log("auto stop_temp:1")
EventMesh.publish("set_temp_state",0)
# EventMesh.publish("set_hr_blood_led",1)
EventMesh.publish(constants.EVENT.START_HEART)
- elif (time_tmp - self.hr_timeSecond) >= 60 and self.HR_Onestate == 1:
+ elif (time_tmp - self.hr_timeSecond) >= 60 and self.HR_Onestate == 1 and get_hr_state == 2:
self.HR_Onestate = 0
EventMesh.publish("set_hr_state",0)#2代表后台进入测试
EventMesh.debug_log("stop debug3")
EventMesh.publish("set_spo2_state",2)#2代表后台进入测试
EventMesh.publish(constants.EVENT.START_BLOOD_OXYGEN)#K开血氧
- elif (time_tmp - self.spo2_timeSecond) >= 60 and self.spo2auto_state == 1:
+ elif (time_tmp - self.spo2_timeSecond) >= 60 and self.spo2auto_state == 1 and get_spo2_state == 2:
EventMesh.publish("set_spo2_state",0)#2代表后台进入测试
self.spo2auto_state = 0
EventMesh.publish(constants.EVENT.STOP_BLOOD_OXYGEN)
# EventMesh.publish("set_hr_blood_led",1)
EventMesh.publish(constants.EVENT.START_HEART)
- elif (time_tmp - self.bp_timeSecond) >= 60 and self.bpauto_state == 1:
+ elif (time_tmp - self.bp_timeSecond) >= 60 and self.bpauto_state == 1 and get_bp_state == 2:
self.bpauto_state = 0
EventMesh.publish("set_bp_state",0)#2代表后台进入测试
blood_data = get_autoblood_value()
# EventMesh.publish("set_hr_blood_led",1)
EventMesh.publish(constants.EVENT.START_HEART)
self.BG_state = 1
- elif (time_tmp - self.bg_timeSecond) >= 60 and self.BG_state == 1:
+ elif (time_tmp - self.bg_timeSecond) >= 60 and self.BG_state == 1 and get_bg_state == 2:
self.BG_state = 0
EventMesh.publish("set_bg_state",0)#2代表后台进入测试
# EventMesh.publish("stop_led_timer")#设置参数
EventMesh.txt_log("auto START_temp:1")
EventMesh.publish(constants.EVENT.START_TEMP)
- elif (time_tmp-self.temp_timeSecond) >= 30 and self.temp_state == 1:
+ elif (time_tmp-self.temp_timeSecond) >= 30 and self.temp_state == 1 and get_temp_state == 2:
self.temp_state = 0
EventMesh.txt_log("auto stop_temp:1")
EventMesh.publish("set_temp_state",0)
# EventMesh.publish("set_hr_blood_led",1)
EventMesh.publish(constants.EVENT.START_HEART)
- elif (time_tmp - self.hr_timeSecond) >= 60 and self.HR_Onestate == 1:
+ elif (time_tmp - self.hr_timeSecond) >= 60 and self.HR_Onestate == 1 and get_hr_state == 2:
self.HR_Onestate = 0
EventMesh.publish("set_hr_state",0)#2代表后台进入测试
EventMesh.debug_log("stop debug3")
EventMesh.publish("set_spo2_state",2)#2代表后台进入测试
EventMesh.publish(constants.EVENT.START_BLOOD_OXYGEN)#K开血氧
- elif (time_tmp - self.spo2_timeSecond) >= 60 and self.spo2auto_state == 1:
+ elif (time_tmp - self.spo2_timeSecond) >= 60 and self.spo2auto_state == 1 and get_spo2_state == 2:
EventMesh.publish("set_spo2_state",0)#2代表后台进入测试
self.spo2auto_state = 0
EventMesh.publish(constants.EVENT.STOP_BLOOD_OXYGEN)
# EventMesh.publish("set_hr_blood_led",1)
EventMesh.publish(constants.EVENT.START_HEART)
- elif (time_tmp - self.bp_timeSecond) >= 60 and self.bpauto_state == 1:
+ elif (time_tmp - self.bp_timeSecond) >= 60 and self.bpauto_state == 1 and get_bp_state == 2:
self.bpauto_state = 0
EventMesh.publish("set_bp_state",0)#2代表后台进入测试
blood_data = get_autoblood_value()
# EventMesh.publish("set_hr_blood_led",1)
EventMesh.publish(constants.EVENT.START_HEART)
self.BG_state = 1
- elif (time_tmp - self.bg_timeSecond) >= 60 and self.BG_state == 1:
+ elif (time_tmp - self.bg_timeSecond) >= 60 and self.BG_state == 1 and get_bg_state == 2:
self.BG_state = 0
EventMesh.publish("set_bg_state",0)#2代表后台进入测试
# EventMesh.publish("stop_led_timer")#设置参数
# ip_addr = "app.api.thisiot.com"
# http://app.api.thisiot.com/
url = "http://app.api.thisiot.com/dev/device/check?imei={}&bid={}&sonce={}&sign={}".format(imei,pid_data,sonce_data,sign_data)
-
+
# print("url:{}".format(url))
response = request.get(url)
data_tmp ={}
TYPE = "SOS"
def send(self, event, msg):
# [XT*334588000000156*0004*MONITOR]
- send_data = self.PID+"*%s*0003*SOS"%(self.imei)
+ send_data = EventMesh.publish("get_new_pid")+"*%s*0003*SOS"%(self.imei)
MD5_SIGN = self.pack_MD5_head(send_data)
data = "[%s%s]"%(str(MD5_SIGN),send_data)
print("sosHome_dial_ProtoCol:data:%s"%(data))
TYPE = "SCREEN_SHOW"
def send(self, event, msg):
# [XT*334588000000156*0006*SILENCETIME2]
- send_data = self.PID+"*%s*000B*SCREEN_SHOW"%(self.imei)
+ send_data = EventMesh.publish("get_new_pid")+"*%s*000B*SCREEN_SHOW"%(self.imei)
MD5_SIGN = self.pack_MD5_head(send_data)
data = "[%s%s]"%(str(MD5_SIGN),send_data)
# print("KEYBRD:data:%s"%(data))