sos提示语
authordxy <1731678236qq.com>
Tue, 19 Aug 2025 09:33:21 +0000 (17:33 +0800)
committerdxy <1731678236qq.com>
Tue, 19 Aug 2025 09:33:21 +0000 (17:33 +0800)
2.sdk/project/7PIN_1_5/sdk/services/microPython/ports/quectel/core/ai_VC.py
2.sdk/project/7PIN_1_5/sdk/services/microPython/ports/quectel/core/protocol.py

index 291cfae..2702766 100644 (file)
@@ -1074,11 +1074,13 @@ class AI_dev(Abstract):
         
     def AI_key_release(self):
         print("AI_key_release")
+        self.KeySOS_timer_count +=1
+        print("self.KeySOS_timer_count:{}".format(self.KeySOS_timer_count))
         if self.KeySOS_timer_flag == 0:
             self.KeySOS_timer_flag = 1
             self.KeySOS_timer_count=0
-            self.KeySOS_timer.start(2000, 0, self.KeySos_timer_cb)
-        self.KeySOS_timer_count +=1
+            self.KeySOS_timer.start(3000, 0, self.KeySos_timer_cb)
+        
         EventMesh.publish("AI_key_release")
         
     def pwk_key_Long_Press(self,event=None,msg=None):
index 5623e2d..5c0aec0 100644 (file)
@@ -1098,7 +1098,14 @@ class sosInfoCallManager(Abstract):
                                 EventMesh.publish("call_out_cb", self.sos_list[2]["phone"]) 
                                 # EventMesh.publish("set_callnumer_cb",self.sos_list[0]["phone"])
             else: #清除表示
-                self.num=0
+                tts_str = "未设置号码"
+                EventMesh.publish("stop_voice_record") #电话优先级最高
+                EventMesh.publish("stop_AI_record")
+                EventMesh.publish("play_tts",[tts_str,1])  #播放tts闹钟文本内容
+                self.sos_flag = 0
+                self.num = 0
+                self.call_state = 0
+                self.num=0 #不管有没有拨打sos都清除
                 self.num_len = 0
                 self.sos_flag = 0
                 #未设置号码
@@ -2716,15 +2723,18 @@ class IOTWeb_chat_configProtoCol(ProtoCol):
         #         "voiceId":"音色ID,火山音色或者科大讯飞音色ID"
         #     }
         # }
+        # {'msg': '.', 'data': {'vadDuration': 600, 'provider': None, '': None, 'speed': '1.0', 'voiceId': ''}, 'ts': 1755593006265, 'cmd': 'chat_config'}
         if "data" in msg:
             data = msg["data"]
             speed = data["speed"]
             vadDuration = data["vadDuration"]
             voiceId = data["voiceId"]
-            if vadDuration !=  None:
-                EventMesh.publish("SET_SPEECH_RATE",speed)
+            if speed !=  None:
+                if len(speed) != 0:
+                    EventMesh.publish("SET_SPEECH_RATE",speed)
             if voiceId != None:
-                EventMesh.publish("set_vad_silence",voiceId)
+                if len(voiceId) != 0:
+                    EventMesh.publish("set_vad_silence",voiceId)
         EventMesh.publish(WEB_CMD_ENUM.CHAT_CONFIG_S)
 #获取AI对话音色配置
 class IOTWeb_get_chat_configProtoCol(ProtoCol):
@@ -3166,6 +3176,7 @@ class IOTWeb_bt_scanProtoCol(ProtoCol):
             data = msg["data"]
             if data == "1":
                 s_ret = "1"
+                
                 EventMesh.publish("send_ble_scan","1")
                 # EventMesh.publish("send_ble_adv_switch","1")
             elif data == "0":