K5
authordxy15521469561 <1731678236@qq.com>
Sat, 23 Dec 2023 10:17:09 +0000 (18:17 +0800)
committerdxy15521469561 <1731678236@qq.com>
Sat, 23 Dec 2023 10:17:09 +0000 (18:17 +0800)
2.sdk/project/K5/sdk/services/microPython/ports/quectel/core/mgr.py
2.sdk/project/K5/sdk/services/microPython/ports/quectel/core/ui.py

index 1925285..5ed6f49 100644 (file)
@@ -584,7 +584,9 @@ def voice_callback(args):
         sos_flag = EventMesh.publish("get_sos_flag")
         if sos_flag == 1:
             sos_flag = 0
+            EventMesh.publish("close_sos_timer")
             EventMesh.publish("set_sos_flag",0)
+            EventMesh.publish("set_sos_num",0)
 
         print('voicecall connected, PhoneNO.: ', args[6])
         size_len = len(str(args[6]))
@@ -3027,6 +3029,8 @@ class getSosFlagManager(Abstract):#设置sos
         EventMesh.subscribe("set_hangup_mode", self.set_hangup_mode)
         EventMesh.subscribe("get_hangup_mode", self.get_hangup_mode)#获取挂断方式 是对方挂断 还是手表按键主动挂断
 
+        EventMesh.subscribe("close_sos_timer",self.close_sos_timer)
+
     def get_hangup_mode(self, event, msg): # 1是设备端手表主动挂断 0是手机端
         return self.hangup_mode
     
@@ -3048,8 +3052,9 @@ class getSosFlagManager(Abstract):#设置sos
                     #voiceCall.callStart(str(number[0]))
 
     def set_callnumer_cb(self, event, msg):
-        self.callnumer = msg
-        self.call_timer.start(10000, 0, self.call_timer_cb)#延迟10S 继续拨打
+        if self.sos_flag == 1:
+            self.callnumer = msg
+            self.call_timer.start(10000, 0, self.call_timer_cb)#延迟10S 继续拨打
 
     def call_timer_cb(self, *args, **kwargs):
         # print("call_timer_cb:{}".format(self.callnumer))
@@ -3057,6 +3062,10 @@ class getSosFlagManager(Abstract):#设置sos
         EventMesh.publish("save_phonenum",str(self.callnumer))
         EventMesh.publish("load_screen", {"screen": "dialing_noplay_popup"})  
 
+    def close_sos_timer(self,event,msg):
+        self.call_timer.stop()
+        pass
+
     def get_sos_flag(self, event, msg): 
         return self.sos_flag
     
index 22cb6bd..558adb4 100644 (file)
@@ -1047,6 +1047,7 @@ class DialingScreen(Screen):
     def hangup(self,e):
         EventMesh.publish("set_UI_high_priority", 0)
         EventMesh.publish("set_hangup_mode", 1)
+        EventMesh.publish("close_sos_timer")
         voiceCall.callEnd()
         EventMesh.publish("set_interrup_incall",0)
         EventMesh.publish("set_UI_high_priority",0)
@@ -1554,8 +1555,8 @@ class DialingNoPlayPopupScreen(Screen):#正在拨号中...未打出
         if self.time_count >= 5:#5s内没有打通则不在继续拨打关闭
             self.time_count = 0
             EventMesh.publish("set_UI_high_priority", 0)
+            voiceCall.callEnd()
             EventMesh.publish("set_sos_info_call") 
-
             EventMesh.publish("load_screen", {"screen": "dial_no_connect_popup"})
 
     def hangup(self,e):
@@ -1563,6 +1564,7 @@ class DialingNoPlayPopupScreen(Screen):#正在拨号中...未打出
         voiceCall.callEnd()
         sos_flag = EventMesh.publish("get_sos_flag")
         if sos_flag == 1:
+            EventMesh.publish("close_sos_timer")
             EventMesh.publish("set_sos_flag",0)
             EventMesh.publish("set_sos_num",0)
             EventMesh.publish("set_hangup_mode",0)
@@ -1629,7 +1631,7 @@ class DialNoconnectPopupScreen(Screen):#你所拨打的电话暂时无法接通
             EventMesh.publish("return_prev_screen")
 
     def Close(self):
-        EventMesh.publish("set_sos_info_call") 
+        # EventMesh.publish("set_sos_info_call") 
         self.timer.stop()
 
     def done_left_to_right(self):
@@ -6454,6 +6456,7 @@ class classMgrPopupScreen(Screen):#上课禁用时间界面
         if sos_flag == 1:
             EventMesh.publish("set_sos_flag",0)
             EventMesh.publish("set_sos_num",0)
+            EventMesh.publish("close_sos_timer")
             EventMesh.publish("set_hangup_mode",0)
         data = RTC().datetime()
         hour = data[4]