# EventMesh.publish("set_led_time_arg",[1000,33000,1,led_mode.FLASH_LIGHT_GREEN,led_mode.DEFAULT_LONG_LIGHT_MODE,led_mode.OTHER_MEASURE_MODE])#设置参数
str_data = 'mp3files={}.mp3'.format(audio_buf.index("audio_find_haixiu"))
EventMesh.publish("play_audio_file",[str_data,1])#获取播放音频文件('U:/static/audio.bin',1,1,str_data)
-
+ EventMesh.publish("set_motor_time",[1,2,8*3,8,4])#设置马达参数
+
def stop_find_watch(self, event, msg):
if self.find_state == 1:
self.find_state = 0
# EventMesh.publish("stop_led_timer")#设置参数
self.aud.stopPlayStream() #播放声音
self.alarm_timer1.stop()
+ EventMesh.publish("close_motor_infor")#关闭马达和定时器
def FIND_timer_cb(self, data):
flag = EventMesh.publish("get_call_state")#在通话或者电话拨进 或者拨出不允许寻找设备
# EventMesh.debug_log("self.FIND_timer_count:{}".format(self.FIND_timer_count))
str_data = 'mp3files={}.mp3'.format(audio_buf.index("audio_find_haixiu"))
EventMesh.publish("play_audio_file",[str_data,1])#获取播放音频文件('U:/static/audio.bin',1,1,str_data)
+ #EventMesh.publish("set_motor_time",[1,2,8*2,8,4])#设置马达参数
self.FIND_timer_count += 1
if self.FIND_timer_count > 10: #120秒30s
EventMesh.publish("STOP_FIND_WATCH")
if self.call_state == 0 and self.fall_flag == 0 and wechat_state == 0 and self.fall_flag == 0 and video_state == 0:
str_data = 'mp3files={}.mp3'.format(audio_buf.index("R_WECHAT_RECV"))
EventMesh.publish("play_audio_file",[str_data,1])#获取播放音频文件
+ EventMesh.publish("set_motor_time",[1,2,10*3,10,5])#设置马达参数
str_data = 'mp3files={}.mp3'.format(audio_buf.index("R_VIDEO_CALL_IN"))
EventMesh.publish("play_audio_file",[str_data,0])#获取播放音频文件
# EventMesh.publish("play_audio_file",str_data)#获取播放音频文件('U:/static/audio.bin',1,1,str_data)
+ EventMesh.publish("set_motor_time",[1,2,10*3,10,5])#设置马达参数
def video_in_timer_cb(self,data):
open_power = EventMesh.publish("get_power_on_state")#获取开机标识
str_data = 'mp3files={}.mp3'.format(audio_buf.index("R_CALL_mp3"))
EventMesh.publish("play_audio_file",[str_data,0])#获取播放音频文件
# EventMesh.publish("play_audio_file",str_data)#获取播放音频文件('U:/static/audio.bin',1,1,str_data)
-
+ EventMesh.publish("set_motor_time",[1,2,10*3,10,5])#设置马达参数
+
def call_timer_cb(self,data):
open_power = EventMesh.publish("get_power_on_state")#获取开机标识
if open_power != None:
# EventMesh.publish("play_audio_file",[str_data,0])#获取播放音频文件('U:/static/audio.bin',1,1,str_data)
self.pwk_timer1.start(1000,0,self.power_on_audio_cb)
+ print("open_power_on!!!!!!!\n\n\n\n")
elif msg == 2:
flag = EventMesh.publish("get_call_state")
if flag != 0:#电话呼叫中
self.power_on_flag = 1
# EventMesh.debug_log("power_on_audio_cb")
power_state = EventMesh.publish("get_storage_config","power_state")
+ #EventMesh.publish("set_motor_time",[1,2,10*2,10,5])#设置马达参数
if power_state == None:
power_state = 0
# print("power_state",power_state)
video_state = EventMesh.publish("get_video_state")
if video_state != 0:#视频通话打入或者接听后允许挂断视频通话
if video_state != 6:#6是app打手表需要接通
- EventMesh.publish("video_dev_reject_cb",2)#挂断视频通话
+ # EventMesh.publish("video_dev_reject_cb",2)#挂断视频通话
return
self.WeChatKey_status = self.wechatKey.read_level()
self.GPIO26_status = self.pwk_key26.read_level()
if video_state == 6:#6 是app拨打手表 1 是手表打app 3 是正在视频通话中 0 关闭只有第一次视频通话打入才允许接听 接通之后不允许接听了
EventMesh.publish("video_answer_cb")
else:
- EventMesh.publish("video_dev_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()
+ pass
+ # EventMesh.publish("video_dev_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")
video_state = EventMesh.publish("get_video_state")
if video_state != 0:#视频通话打入或者接听后允许挂断视频通话
if video_state != 6:#6是app打手表需要接通
- EventMesh.publish("video_dev_reject_cb",2)#挂断视频通话
+ # EventMesh.publish("video_dev_reject_cb",2)#挂断视频通话
return
self.WeChatKey_status = self.wechatKey.read_level()
self.GPIO26_status = self.pwk_key26.read_level()
print("pwk_extint_cb")
# EventMesh.publish("video_answer_cb")
else:
- EventMesh.publish("video_dev_reject_cb",2)#挂断视频通话
+ pass
+ # EventMesh.publish("video_dev_reject_cb",2)#挂断视频通话
return
self.WeChatKey_status = self.wechatKey.read_level()
pass
elif self.sosKey_press_count == 3:#视频通话
self.sosKey_press_count = 0
- battery = EventMesh.publish("screen_get_battery")
- if battery != None:
- if battery[0] != "1":#在充电得时候
- return
- pass
call_state = EventMesh.publish("get_call_state")
battery = EventMesh.publish("screen_get_battery")
if call_state == None:
video_state = EventMesh.publish("get_video_state")
if video_state != 0:#视频通话打入或者接听后允许挂断视频通话
if video_state != 6:#6是app打手表需要接通
- EventMesh.publish("video_dev_reject_cb",2)#挂断视频通话
+ # EventMesh.publish("video_dev_reject_cb",2)#挂断视频通话
return
self.sosKey_status = self.sosKey.read_level()
video_state = EventMesh.publish("get_video_state")
if video_state != 0:#视频通话打入或者接听后允许挂断视频通话
if video_state != 6:#6是app打手表需要接通
- EventMesh.publish("video_dev_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()
+ # EventMesh.publish("video_dev_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
if self.wechatKey_press == 0:
self.wechatKey_timer.stop()