if self.KeyCall1_status == 0:
video_state = EventMesh.publish("get_video_state")
if video_state != 0:#视频通话打入或者接听后允许挂断视频通话
- if video_state == 6:#6是app打手表需要接通
- print("key17_extint_cb")
- EventMesh.publish("video_answer_cb")
- else:
+ if video_state != 6:#6是app打手表需要接通
EventMesh.publish("video_reject_cb",2)#挂断视频通话
- return
+ return
self.WeChatKey_status = self.wechatKey.read_level()
self.GPIO26_status = self.pwk_key26.read_level()
self.KeyCall2_status = self.extint_19.read_level()
EventMesh.debug_log('key17_extint_cb',args,self.KeyCall2_status,self.WeChatKey_status,self.GPIO26_status,self.KeyCall1_status,self.sosKey_status) # args[0]:gpio号 args[1]:上升沿或下降沿
if self.WeChatKey_status != 0 and self.GPIO26_status != 0 and self.KeyCall2_status != 0 and self.sosKey_status != 0:
if self.KeyCall1_status == 0:#按下
- # if NEW_ENABLE == 0:#新的按键功能定义
- # video_state = EventMesh.publish("get_video_state")
- # if video_state != 0:#视频通话打入或者接听后允许挂断视频通话
- # if video_state == 6:#6是app打手表需要接通
- # print("key17_extint_cb")
- # EventMesh.publish("video_answer_cb")
- # else:
- # EventMesh.publish("video_reject_cb",2)#挂断视频通话
- # self.Keycall1_press_count=0
- # self.wechatKey_timer.stop()
- # self.pwkey_timer.stop()
- # self.sosKey_timer.stop()
- # self.Keycall2_timer.stop()
- # self.Keycall1_timer.stop()
- # return
+ if NEW_ENABLE == 0:#新的按键功能定义
+ video_state = EventMesh.publish("get_video_state")
+ if video_state != 0:#视频通话打入或者接听后允许挂断视频通话
+ if video_state != 6:#6是app打手表需要接通
+ EventMesh.publish("video_reject_cb",2)#挂断视频通话
+ self.Keycall1_press_count=0
+ self.wechatKey_timer.stop()
+ self.pwkey_timer.stop()
+ self.sosKey_timer.stop()
+ self.Keycall2_timer.stop()
+ self.Keycall1_timer.stop()
+ return
EventMesh.publish("close_wechat_btn_timer")
if self.Keycall1_press == 0 :
self.wechatKey_timer.stop()
if self.KeyCall2_status == 0:
video_state = EventMesh.publish("get_video_state")
if video_state != 0:#视频通话打入或者接听后允许挂断视频通话
- if video_state == 6:#6是app打手表需要接通
- print("key17_extint_cb")
- EventMesh.publish("video_answer_cb")
- else:
-
+ if video_state != 6:#6是app打手表需要接通
EventMesh.publish("video_reject_cb",2)#挂断视频通话
- return
+ return
self.WeChatKey_status = self.wechatKey.read_level()
self.GPIO26_status = self.pwk_key26.read_level()
# self.KeyCall1_status = self.extint_17.read_level()
# EventMesh.debug_log('self.KeyCall1_status :{}',args,self.KeyCall1_status) # args[0]:gpio号 args[1]:上升沿或下降沿
if self.WeChatKey_status != 0 and self.GPIO26_status != 0 and self.KeyCall1_status != 0 and self.sosKey_status != 0:
if self.KeyCall2_status == 0:#按下
- video_state = EventMesh.publish("get_video_state")
- if video_state != 0:#视频通话打入或者接听后允许挂断视频通话
- if video_state == 6:#6是app打手表需要接通
- print("key19_extint_cb")
- EventMesh.publish("video_answer_cb")
- # else:
- # EventMesh.publish("video_reject_cb",2)#挂断视频通话
-
- self.Keycall2_press_count = 0
- self.wechatKey_timer.stop()
- self.pwkey_timer.stop()
- self.sosKey_timer.stop()
- self.Keycall2_timer.stop()
- self.Keycall1_timer.stop()
- return
EventMesh.publish("close_wechat_btn_timer")
if self.Keycall2_press == 0 :
self.wechatKey_timer.stop()
EventMesh.publish("set_manual_measure_mode",3)#测量体温
elif self.Keycall2_press_count == 1:#
self.Keycall2_press_count = 0
- # video_state = EventMesh.publish("get_video_state")
- # print("video_state ",video_state)
- # if video_state != 0:
- # if video_state == 2:#2 是app拨打手表 1 是手表打app 3 是正在视频通话中 0 关闭只有第一次视频通话打入才允许接听 接通之后不允许接听了
- # EventMesh.publish("video_answer_cb")
- # return
+ video_state = EventMesh.publish("get_video_state")
+ print("video_state ",video_state)
+ if video_state != 0:
+ if video_state == 6:#6 是app拨打手表 1 是手表打app 3 是正在视频通话中 0 关闭只有第一次视频通话打入才允许接听 接通之后不允许接听了
+ EventMesh.publish("video_answer_cb")
+ return
EventMesh.publish("stop_led_timer")#设置参数
call_state = EventMesh.publish("get_call_state")
if self.WeChatKey_status == 0:
video_state = EventMesh.publish("get_video_state")
if video_state != 0:#视频通话打入或者接听后允许挂断视频通话
- if video_state == 6:#6是app打手表需要接通
- # print("wechatKey_extint_cb")
- EventMesh.publish("video_answer_cb")
- else:
+ if video_state != 6:#6是app打手表需要接通
EventMesh.publish("video_reject_cb",2)#挂断视频通话
- return
+ return
# self.sosKey_status = self.sosKey.read_level()
self.GPIO26_status = self.pwk_key26.read_level()
if self.WeChatKey_status == 0:#按下
video_state = EventMesh.publish("get_video_state")
if video_state != 0:#视频通话打入或者接听后允许挂断视频通话
- if video_state == 6:#6是app打手表需要接通
- print("wechatKey_extint_cb")
- EventMesh.publish("video_answer_cb")
- else:
+ if video_state != 6:#6是app打手表需要接通
EventMesh.publish("video_reject_cb",2)#挂断视频通话
-
- self.wechatKey_press_count = 0
- self.wechatKey_timer.stop()
- self.pwkey_timer.stop()
- self.sosKey_timer.stop()
- self.Keycall2_timer.stop()
- self.Keycall1_timer.stop()
- return
+ self.wechatKey_press_count = 0
+ self.wechatKey_timer.stop()
+ self.pwkey_timer.stop()
+ self.sosKey_timer.stop()
+ self.Keycall2_timer.stop()
+ self.Keycall1_timer.stop()
+ return
if self.wechatKey_press == 0:
self.wechatKey_timer.stop()
self.pwkey_timer.stop()
video_state = EventMesh.publish("get_video_state")
print("video_state call",video_state)
if video_state != 0:
- if video_state == 2:#2 是app拨打手表 1 是手表打app 3 是正在视频通话中 0 关闭只有第一次视频通话打入才允许接听 接通之后不允许接听了
+ if video_state == 6:#2 是app拨打手表 1 是手表打app 3 是正在视频通话中 0 关闭只有第一次视频通话打入才允许接听 接通之后不允许接听了
EventMesh.publish("video_answer_cb")
return
call_state = EventMesh.publish("get_call_state")