连接配置去掉
authordxy <1731678236qq.com>
Wed, 27 Aug 2025 02:37:25 +0000 (10:37 +0800)
committerdxy <1731678236qq.com>
Wed, 27 Aug 2025 02:37:25 +0000 (10:37 +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/ai_alarm.py
2.sdk/project/7PIN_1_5/sdk/services/microPython/ports/quectel/core/protocol.py

index 5191aa5..0a2bc21 100644 (file)
@@ -1152,8 +1152,8 @@ class AI_dev(Abstract):
                     self.KeyAI_timer.start(100, 1, self.KeyAI_timer_cb)
                     self.KeyAI_timer_count = 0
                     #EventMesh.publish("AI_key_press")
-                    # if dev_type == "7PIN" or dev_type == "7PIN_coze" :
-                    #     self.aud.aud_tone_play(10,400)#播放按键音
+                    if dev_type == "7PIN" or dev_type == "7PIN_coze" :
+                        self.aud.aud_tone_play(10,400)#播放按键音
                     EventMesh.publish("publish_AI_btnInfo",{"func":self.AI_key_press})  
         except Exception as e: 
             usys.print_exception(e)
@@ -2165,10 +2165,10 @@ class AI_VC(Abstract):
         # voiceCall.callStart("10086")
         # return
         
-        try:
-            self.http_get_config()#获取/更新配置参数
-        except Exception as e:
-            usys.print_exception(e)
+        # try:
+        #     self.http_get_config()#获取/更新配置参数
+        # except Exception as e:
+        #     usys.print_exception(e)
         self.VC_30S_timer = osTimer()
         self.VC_30S_timer.start(30000, 1, self.VC_30S_timer_cb)
         self.online_kws = 1#是否开启线上关键词
@@ -2349,51 +2349,98 @@ class AI_VC(Abstract):
                                         }
             else:
                 #女,男,童,粤,川,个性声
-                self.VC_TTS_voice_type = {   
+                self.VC_TTS_voice_type = {
                                             "女":{
                                             "bot_name":"柒妹妹",
                                             "voice":"zh_female_wanwanxiaohe_moon_bigtts" ,
-                                            "outbound_attributess_provider":"volcengine",
-                                            "inbound_attributess_provider":"xun-fei"
+                                            "lang":"zh-cn"
                                             },
                                             "男":{
                                             "bot_name":"柒先生",
                                             "voice":"zh_male_wennuanahu_moon_bigtts"  ,
-                                            "outbound_attributess_provider":"volcengine",
-                                            "inbound_attributess_provider":"xun-fei"
+                                            "lang":"zh-cn"
                                             },
                                             "童":{
                                             "bot_name":"柒乐乐",
                                             "voice":"ICL_zh_female_huoponvhai_tob"  ,
-                                            "outbound_attributess_provider":"volcengine",
-                                            "inbound_attributess_provider":"xun-fei"
-                                            },
-                                            "粤":{
-                                            "bot_name":"柒先生",
-                                            "voice":"zh_female_wanqudashu_moon_bigtts" ,
-                                            "outbound_attributess_provider":"volcengine",
-                                            "inbound_attributess_provider":"xun-fei"
-                                            },
-                                            "四川":{
-                                            "bot_name":"柒妹妹",
-                                            "voice":"zh_female_daimengchuanmei_moon_bigtts",
-                                            "outbound_attributess_provider":"volcengine",
-                                            "inbound_attributess_provider":"xun-fei"
-                                            },
-                                            "个性":{
-                                            "bot_name":"柒先生",
-                                            "voice":"zh_male_sunwukong_mars_bigtts" ,
-                                            "outbound_attributess_provider":"volcengine",
-                                            "inbound_attributess_provider":"xun-fei"
+                                            "lang":"zh-cn"
                                             },
-                                            "英语":{
-                                            "bot_name":"柒先生",
-                                            "voice":"en_male_smith_mars_bigtts" ,
-                                            "outbound_attributess_provider":"volcengine",
-                                            "inbound_attributess_provider":"xun-fei"
-                                            }
-                                            
-                                           
+                                            "闽南": {
+                                                "bot_name": "柒妹妹",
+                                                "voice": "x3_linlin",
+                                                "lang": "zh-cn"
+                                                },
+                                            "上海": {
+                                                "bot_name": "柒妹妹",
+                                                "voice": "x3_ziling",
+                                                "lang": "zh-cn"
+                                                },
+                                            "安徽合肥": {
+                                                "bot_name": "柒先生",
+                                                "voice": "x2_xiaofei",
+                                                "lang": "zh-cn"
+                                                },
+                                            "香港粤语": {
+                                                "bot_name": "柒妹妹",
+                                                "voice": "x3_xiaoyue",
+                                                "lang": "zh-cn"
+                                                },
+                                            "山东话": {
+                                                "bot_name": "柒妹妹",
+                                                "voice": "x2_xiaodong",
+                                                "lang": "zh-cn"
+                                                },
+                                            "陕西": {
+                                                "bot_name": "柒妹妹",
+                                                "voice": "x2_xiaoying",
+                                                "lang": "zh-cn"
+                                                },
+                                            "广东": {
+                                                "bot_name": "柒妹妹",
+                                                "voice": "x_xiaomei",
+                                                "lang": "zh-cn"
+                                                },
+                                            "成都": {
+                                                "bot_name": "柒妹妹",
+                                                "voice": "x3_xiaodu",
+                                                "lang": "zh-cn"
+                                                },
+                                            "湖南": {
+                                                "bot_name": "柒先生",
+                                                "voice": "x2_xiaoqiang",
+                                                "lang": "zh-cn"
+                                                },
+                                            "苏州": {
+                                                "bot_name": "柒妹妹",
+                                                "voice": "x2_SuhCn_XiXi",
+                                                "lang": "zh-cn"
+                                                },
+                                            "东北": {
+                                                "bot_name": "柒妹妹",
+                                                "voice": "x2_xiaoqian",
+                                                "lang": "zh-cn"
+                                                },
+                                            "四川": {
+                                                "bot_name": "柒妹妹",
+                                                "voice": "x3_yezi_sc",
+                                                "lang": "zh-cn"
+                                                },
+                                            "河南": {
+                                                "bot_name": "柒先生",
+                                                "voice": "x2_xiaokun",
+                                                "lang": "zh-cn"
+                                                },
+                                            "湖北": {
+                                                "bot_name": "柒先生",
+                                                "voice": "x2_xiaowang",
+                                                "lang": "zh-cn"
+                                                }
+                                                ,
+                                            "内蒙古话": {
+                                                "bot_name": "柒先生",
+                                                "voice": "x2_xiaobao",
+                                                "lang": "zh-cn"
+                                                }
                                         }
             
             # self.VC_TTS_voice_type = {0:"zh_female_xinlingjitang_moon_bigtts",1:"zh_male_wennuanahu_moon_bigtts",2:"ICL_zh_female_huoponvhai_tob",
@@ -2746,8 +2793,7 @@ class AI_VC(Abstract):
         self.VC_Speech_Start()    
         
         self.AI_VC_start() 
-        if dev_type == "7PIN" :
-            self.aud.aud_tone_play(10,400)#播放按键音
+        
         # if dev_type != "7PIN":
         #     self.chenggong_tone()
         # self.Close()
index 6f86bd0..d373f66 100644 (file)
@@ -59,7 +59,6 @@ class AI_alarm(Abstract):
 
         EventMesh.subscribe("AI_alarm_close",self.AI_alarm_close)
         EventMesh.subscribe("AI_alarm_open",self.AI_alarm_open)
-        EventMesh.subscribe("AI_alarm_poll_extern",self.AI_alarm_poll_extern)
         EventMesh.subscribe("AI_add_alarm",self.AI_add_alarm)
         EventMesh.subscribe("alarm_get_statu",self.alarm_get_statu)
         EventMesh.subscribe("get_have_alarm",self.get_have_alarm)
@@ -311,13 +310,17 @@ class AI_alarm(Abstract):
                             AringTimes = 1
                         tts_str = [tts_audio] * AringTimes
                         print(tts_str)
-                        if ringUrl == None:
-                            pass
-                            # EventMesh.publish("audio_montage_play",tts_str) 
-                        else:
+                        if ringUrl != None:
                             pass
                             # EventMesh.publish("play_new_voice",[ringUrl,1])
-                        pass
+                        if ringUrl == None:
+                            base_sentence = "{}".format(name)
+                            if AringTimes == 0:
+                                AringTimes = 1
+                            repeat_sentence = (base_sentence + ",") * AringTimes  # 重复5次并加逗号分隔
+                            final_sentence = repeat_sentence.rstrip(",")
+                            
+                            EventMesh.publish("play_tts",[final_sentence,1])  #播放tts闹钟文本内容
                     elif alarmMode == "shake": #只振动
                         if shakeType == "short":
                             EventMesh.publish("set_motor_time",[1,1,5,8,4])#设置马达参数
@@ -325,43 +328,41 @@ class AI_alarm(Abstract):
                         elif shakeType == "long":
                             EventMesh.publish("set_motor_time",[1,1,5*2*2,8,4])#设置马达参数
                             pass 
+                        base_sentence = "{}".format(name)
+                        if AringTimes == 0:
+                            AringTimes = 1
+                        repeat_sentence = (base_sentence + ",") * AringTimes  # 重复5次并加逗号分隔
+                        final_sentence = repeat_sentence.rstrip(",")
+                        
+                        EventMesh.publish("play_tts",[final_sentence,1])  #播放tts闹钟文本内容
+
                     elif alarmMode == "both": #响铃加振动
                         tts_audio = "chenggong.mp3"
                         if AringTimes == 0:
                             AringTimes = 1
                         tts_str = [tts_audio] * AringTimes
-                        if ringUrl == None:
-                            pass
-                            # EventMesh.publish("audio_montage_play",tts_str) 
-                        else:
-                            pass
+                        if ringUrl != None:
                             # EventMesh.publish("play_new_voice",[ringUrl,1])
-                        # EventMesh.publish("audio_montage_play",tts_str) 
+                            pass
                         if shakeType == "short":
                             EventMesh.publish("set_motor_time",[1,1,5,8,4])#设置马达参数
                             pass
                         elif shakeType == "long":
                             EventMesh.publish("set_motor_time",[1,1,5*2*2,8,4])#设置马达参数
                         
-                        # EventMesh.publish("audio_montage_play",["chenggong.mp3"]) 
-                        pass
-                    base_sentence = "{}".format(name)
-                    if AringTimes == 0:
-                        AringTimes = 1
-                    repeat_sentence = (base_sentence + ",") * AringTimes  # 重复5次并加逗号分隔
-                    final_sentence = repeat_sentence.rstrip(",")
-                    
-                    EventMesh.publish("play_tts",[final_sentence,1])  #播放tts闹钟文本内容
+                        if ringUrl == None:
+                            base_sentence = "{}".format(name)
+                            if AringTimes == 0:
+                                AringTimes = 1
+                            repeat_sentence = (base_sentence + ",") * AringTimes  # 重复5次并加逗号分隔
+                            final_sentence = repeat_sentence.rstrip(",")
+                            
+                            EventMesh.publish("play_tts",[final_sentence,1])  #播放tts闹钟文本内容
 
             except Exception as e:
                 usys.print_exception(e)
                 pass
 
-
-    def AI_alarm_poll_extern(self,event=None,msg=None):#外部调用轮询间隔,关闭定时器调用
-        self.AI_alarm_timer.start(1000, 1, self.AI_alarm_timer_cb)
-        EventMesh.publish("publish_AI_btnInfo",{"func":self.AI_alarm_poll}) 
-
     #params_json:
     # {"alarm": 
     # [
index 12ebe53..6abde46 100644 (file)
@@ -947,7 +947,7 @@ class sosInfoCallManager(Abstract):
         # self.start_phone110112()
         pass
     def get_sos_flag(self,event,msg):
-        if self.sos_flag == 1 or self.phone110112_flag == 1:
+        if self.call_state != 0:
             return 1
         else:
             return 0
@@ -959,7 +959,7 @@ class sosInfoCallManager(Abstract):
     def stop_sos_call(self,event,msg): #停止sos拨打
         EventMesh.publish("publish_AI_btnInfo",{"func":self.stop_sos_call_cb})
     def stop_sos_call_cb(self):
-        if self.sos_flag == 0 or self.phone110112_flag == 0:
+        if self.call_state == 0:
             return
         self.phone110112_flag=0
         self.sos_flag = 0
@@ -1069,7 +1069,7 @@ class sosInfoCallManager(Abstract):
         if self.call_state != 0:
             return
         if len(self.sos_list) > 0:
-            pass
+            self.call_state = 0
             self.call_sos_cb(1)
         else:
             tts_str = "未设置号码"
@@ -1083,6 +1083,7 @@ class sosInfoCallManager(Abstract):
             self.phone110112_flag=0
 
     def call_sos_cb(self,*argc):
+        self.phone110112_flag=0
         if self.sos_flag == 0:
             self.sos_flag = 1
         sos_flag = self.sos_flag
@@ -1104,6 +1105,7 @@ class sosInfoCallManager(Abstract):
                     self.num_len = len(self.sos_list)*3 #1+3+5
                 # EventMesh.debug_log("number:{} number_len :{} num:{} num_len:{}".format(number,len(number),num,num_len))
                 if self.num > self.num_len :
+                    
                     self.start_phone110112()
                     EventMesh.debug_log("call phone!!!!!!!")
                     self.sos_flag = 0
@@ -1161,7 +1163,7 @@ class sosInfoCallManager(Abstract):
                 self.call_state = 0
                 self.num=0 #不管有没有拨打sos都清除
                 self.num_len = 0
-                self.sos_flag = 0
+                self.phone110112_flag=0
                 #未设置号码
             
 
@@ -1170,16 +1172,19 @@ class sosInfoCallManager(Abstract):
         if args[0] == 10: #电话拨进来
             self.sos_flag = 0
             self.call_state = 1 
+            self.phone110112_flag=0
         elif args[0] == 11: #已接听
             self.call_state = 2
             self.num=0 #不管有没有拨打sos都清除
             self.num_len = 0
             self.sos_flag = 0
+            self.phone110112_flag=0
             self.close_call_timer()
 
             EventMesh.debug_log('voicecall connected, PhoneNO.: ', args[6])
 
         elif args[0] == 12: #电话挂断
+            self.phone110112_flag=0
             if self.call_state == 2 or self.call_state == 1: #电话拨出去没有接听 就挂断
                 pass
             else:
@@ -1187,7 +1192,8 @@ class sosInfoCallManager(Abstract):
                 EventMesh.debug_log('voicecall disconnect end !!!')
                 self.close_call_timer()
                 self.call_state = 0
-                EventMesh.publish("set_sos_info_call")
+                if self.sos_flag == 1:
+                    EventMesh.publish("set_sos_info_call")
                 pass
             self.call_state = 0
                 #再次拨打下一个电话号码