From: dxy <1731678236qq.com> Date: Thu, 18 Sep 2025 02:48:18 +0000 (+0800) Subject: 柒牌1代编译区分 X-Git-Url: http://git.snicker.com.cn/Users/apple/Desktop/static/gitweb.css?a=commitdiff_plain;h=910f6323d68690f3d19dbbb7a0796f2d745fb1b8;p=mirrors%2FASR1603_G5.git 柒牌1代编译区分 语音留言模式30s没有按键响应退出语音留言模式 --- diff --git a/2.sdk/project/7PIN_1_5/sdk/services/microPython/ports/quectel/core/ai_VC.py b/2.sdk/project/7PIN_1_5/sdk/services/microPython/ports/quectel/core/ai_VC.py index 30e0d4c9..576ebdc6 100644 --- a/2.sdk/project/7PIN_1_5/sdk/services/microPython/ports/quectel/core/ai_VC.py +++ b/2.sdk/project/7PIN_1_5/sdk/services/microPython/ports/quectel/core/ai_VC.py @@ -46,7 +46,8 @@ PRESS_AUDIO_MODE = 0 #是按键音 0 是使用音频文件 #dev_type = "7PIN_BK_coze"#k扣子小瑞 #dev_type = "7PIN_BK_EU"#英文小瑞 #dev_type = "7PIN_coze"#柒牌扣子 -dev_type = "7PIN"#柒牌 +# dev_type = "7PIN"#柒牌 +dev_type = "7PIN_1_5"#柒牌1.5 #dev_type = 'momo'#食梦貘 #dev_type = 'sjgq'#四季甘泉 #dev_type = 'szbst'#深圳百事通 @@ -64,11 +65,15 @@ class AI_led(Abstract): #self.led_green = Pin(Pin.GPIO21, Pin.OUT, Pin.PULL_PD, 1) self.led_green = Pin(Pin.GPIO8, Pin.OUT, Pin.PULL_PD, 1) self.led_blue = Pin(Pin.GPIO19, Pin.OUT, Pin.PULL_PD, 1) - else: + elif dev_type == "7PIN_1_5": self.led_red = Pin(Pin.GPIO28, Pin.OUT, Pin.PULL_PD, 0) #self.led_green = Pin(Pin.GPIO21, Pin.OUT, Pin.PULL_PD, 1) self.led_green = Pin(Pin.GPIO44, Pin.OUT, Pin.PULL_PD, 1) self.led_blue = Pin(Pin.GPIO30, Pin.OUT, Pin.PULL_PD, 1) + else: + self.led_red = Pin(Pin.GPIO36, Pin.OUT, Pin.PULL_PD, 0) + self.led_green = Pin(Pin.GPIO21, Pin.OUT, Pin.PULL_PD, 1) + self.led_blue = Pin(Pin.GPIO19, Pin.OUT, Pin.PULL_PD, 1) #=1 红灯闪,=2白灯闪,=3绿灯闪,=4全部灯闪 self.led_flicker_flag = 0 @@ -246,13 +251,13 @@ class AI_UART(): self.ping_json_str_tmp ="" self.read_uart_data = "" self.bt_versions="" - - self.uart_send_queue = Queue(100) - self.uart_send_queue_thread_id = _thread.start_new_thread(self.uart_send_queue_thread, ()) + if dev_type == "7PIN_1_5": + self.uart_send_queue = Queue(100) + self.uart_send_queue_thread_id = _thread.start_new_thread(self.uart_send_queue_thread, ()) - self.uart_recv_queue = Queue(100) - self.uart_recv_queue_thread_id = _thread.start_new_thread(self.uart_recv_queue_thread, ()) - self.send_get_versions()#获取蓝牙版本 + self.uart_recv_queue = Queue(100) + self.uart_recv_queue_thread_id = _thread.start_new_thread(self.uart_recv_queue_thread, ()) + self.send_get_versions()#获取蓝牙版本 def uart_send_queue_thread(self): while True: @@ -731,6 +736,8 @@ class AI_UART(): print("bt_send_end") def send_data(self,str_data,need_resend = None,ACK_time =None): + if dev_type != "7PIN_1_5": #不是1.5代不能发串口数据 + return if self.bt_ota_flag == 1: print("ota 中不需要上传") return @@ -975,7 +982,8 @@ class AI_dev(Abstract): # set_ipv4_datacall() self.is_wdt = 0 #是否开启看门狗 #AT+QDAI=1,0,0,1,0,0,1,1PCM音频输出设置为主模式、短同步、16 kHz采样率和256 kHz时钟频率,采样位深为16bit,使用的时间间隙数量为1,并且使用第一个时间间隙。 - audio.set_qdai_cfg(1,0,0,2,0,1,1,1) + if dev_type == "7PIN_1_5" : + audio.set_qdai_cfg(1,0,0,2,0,1,1,1) self.VBATT_tab = {"charge_full":4300,"100" :4250 , "90":4179 , "80":4070, "60": 3883, "40":3770, "20":3699, "10":3652,"5":3600,} self.KeyAI_status = 0 self.KeyAI_timer_count = 0 @@ -986,10 +994,7 @@ class AI_dev(Abstract): self.wdt = WDT(30) #开启看门狗 # self.wdt_timer = osTimer() # self.wdt_timer.start(5000, 1, self.wdt_timer_cb) - #马达 - self.PIN_MOT=Pin(Pin.GPIO36, Pin.OUT, Pin.PULL_DISABLE, 0) - #蓝牙电源 - self.PIN_BT_ON =Pin(Pin.GPIO31, Pin.OUT, Pin.PULL_DISABLE, 0) + count = 0 while True: count += 1 @@ -1017,23 +1022,31 @@ class AI_dev(Abstract): elif dev_type == "7PIN_BK_EU": self.pwk_key = ExtInt(ExtInt.GPIO41, ExtInt.IRQ_RISING_FALLING, ExtInt.PULL_PU, self.pwk_extint_cb) self.extint_AI = ExtInt(ExtInt.GPIO5,ExtInt.IRQ_RISING_FALLING, ExtInt.PULL_PU, self.keyAI_extint_cb) - else: + #蓝牙唤醒4G中断 + elif dev_type == "7PIN_1_5": self.pwk_key = ExtInt(ExtInt.GPIO41, ExtInt.IRQ_RISING_FALLING, ExtInt.PULL_PU, self.pwk_extint_cb) self.extint_AI = ExtInt(ExtInt.GPIO43,ExtInt.IRQ_RISING_FALLING, ExtInt.PULL_PU, self.keyAI_extint_cb) - #self.extint_AI = ExtInt(ExtInt.GPIO22,ExtInt.IRQ_RISING_FALLING, ExtInt.PULL_PU, self.keyAI_extint_cb) - #蓝牙唤醒4G中断 - self.extint_wakeup_cta1 = ExtInt(ExtInt.GPIO22,ExtInt.IRQ_RISING, ExtInt.PULL_DISABLE, self.wakeup_extint_cb) - #4G唤醒蓝牙中断 - self.PIN_wakeup_bt =Pin(Pin.GPIO21, Pin.OUT, Pin.PULL_DISABLE, 0) - - #马达 - self.PIN_MOT.write(1) - utime.sleep_ms(200) - self.PIN_MOT.write(0) - - self.PIN_BT_ON.write(1) - self.extint_wakeup_cta1_timer = osTimer() - self.extint_wakeup_cta1.enable() + + self.extint_wakeup_cta1 = ExtInt(ExtInt.GPIO22,ExtInt.IRQ_RISING, ExtInt.PULL_DISABLE, self.wakeup_extint_cb) + #4G唤醒蓝牙中断 + self.PIN_wakeup_bt =Pin(Pin.GPIO21, Pin.OUT, Pin.PULL_DISABLE, 0) + #马达 + self.PIN_MOT=Pin(Pin.GPIO36, Pin.OUT, Pin.PULL_DISABLE, 0) + #蓝牙电源 + self.PIN_BT_ON =Pin(Pin.GPIO31, Pin.OUT, Pin.PULL_DISABLE, 0) + #马达 + self.PIN_MOT.write(1) + utime.sleep_ms(200) + self.PIN_MOT.write(0) + + self.PIN_BT_ON.write(1) + self.extint_wakeup_cta1_timer = osTimer() + self.extint_wakeup_cta1.enable() + else: + self.pwk_key = ExtInt(ExtInt.GPIO41, ExtInt.IRQ_RISING_FALLING, ExtInt.PULL_PU, self.pwk_extint_cb) + #self.extint_AI = ExtInt(ExtInt.GPIO19,ExtInt.IRQ_RISING_FALLING, ExtInt.PULL_PU, self.keyAI_extint_cb) + self.extint_AI = ExtInt(ExtInt.GPIO22,ExtInt.IRQ_RISING_FALLING, ExtInt.PULL_PU, self.keyAI_extint_cb) + self.extint_AI.enable() self.pwk_key_status = 0 self.pwk_key_timer_count = 0 @@ -1086,7 +1099,9 @@ class AI_dev(Abstract): #EventMesh.publish("audio_montage_play",["xianyikaiji.mp3"]) #EventMesh.publish("publish_AI_btnInfo",{"func":self.ntptime_cb}) self.check_rest_timer_count = 0 - self.ai_uart = AI_UART() + if dev_type == "7PIN_1_5": #不是1.5代不能发串口数据 + self.ai_uart = AI_UART() + self.Keycall1_press_count = 0 self.ble_switch_flag_time = osTimer() self.ble_switch_flag_time.start(10000, 0, self.ble_switch_flag_time_init) @@ -1196,12 +1211,16 @@ class AI_dev(Abstract): #print("publish_AI_btnInfo 2") def sys_sleep_cb(self,event=None,msg=None):#休眠前回调 + if dev_type != "7PIN_1_5": #不是1.5代不能发串口数据 + return print("sys_sleep_cb!!!!!!!!!!!!!!!") print("sys_sleep_cb!!!!!!!!!!!!!!!") print("sys_sleep_cb!!!!!!!!!!!!!!!") EventMesh.publish("sleep_BT")#休眠蓝牙 self.PIN_wakeup_bt.write(0) def sys_up_cb(self,event=None,msg=None):#唤醒前回调 + if dev_type != "7PIN_1_5": #不是1.5代不能发串口数据 + return print("sys_up_cb!!!!!!!!!!!!!!!") print("sys_up_cb!!!!!!!!!!!!!!!") print("sys_up_cb!!!!!!!!!!!!!!!") @@ -1215,6 +1234,8 @@ class AI_dev(Abstract): utime.sleep_ms(100) self.PIN_BT_ON.write(1) def wakeup_BT(self,event=None,msg=None):#4G唤醒蓝牙 + if dev_type != "7PIN_1_5": #不是1.5代不能发串口数据 + return print("wakeup_BT!!!!!!!!!!!!!!!") print("wakeup_BT!!!!!!!!!!!!!!!") wakeup_cta1_io = self.extint_wakeup_cta1.read_level() @@ -1239,6 +1260,8 @@ class AI_dev(Abstract): def sleep_BT(self,event=None,msg=None):#使蓝牙休眠 + if dev_type != "7PIN_1_5": #不是1.5代不能发串口数据 + return print("sleep_BT!!!!!") print("sleep_BT!!!!!") print("sleep_BT!!!!!") @@ -1255,6 +1278,8 @@ class AI_dev(Abstract): def wakeup_extint_cb(self,args):#蓝牙唤醒4g + if dev_type != "7PIN_1_5": #不是1.5代不能发串口数据 + return print("wakeup_extint_cb:!!!!!!!!!") EventMesh.publish(constants.EVENT.SYSTEM_UP)#唤醒休眠 self.PIN_wakeup_bt.write(1) @@ -2346,7 +2371,7 @@ class OTA(): url =None if dev_type == "7PIN_BK_EU":#英文小瑞 url = "http://dmp-global.raisound.com/bz-api/ota/result?deviceId={}¤tVersion={}".format(modem.getDevImei(),currentVersion) - if dev_type == "7PIN" or dev_type == "7PIN_coze":#柒牌 + if dev_type == "7PIN" or dev_type == "7PIN_1_5" or dev_type == "7PIN_coze":#柒牌 url = "http://ota.qipai.com/bz-cmp-api/api/result?deviceId={}¤tVersion={}".format(modem.getDevImei(),currentVersion) else: url = "http://dmp.raisound.com/bz-api/ota/result?deviceId={}¤tVersion={}".format(modem.getDevImei(),currentVersion) @@ -2495,7 +2520,7 @@ class AI_VC(Abstract): if dev_type == 'jswm' or dev_type == 'jswm_BOX':# #self.server_ip="115.190.94.208:22080" self.server_ip="118.145.158.207:22086" - elif dev_type == "7PIN" : + elif dev_type == "7PIN" or dev_type == "7PIN_1_5": #self.server_ip="sevenpin.qipai.com.cn" # self.server_ip="220.160.104.34" # self.server_ip="118.145.158.207:22082" @@ -2519,7 +2544,7 @@ class AI_VC(Abstract): #开机提示音 self.power_on_tone = EventMesh.publish("get_storage_config","power_on_tone")# - if dev_type != "7PIN" and dev_type != "7PIN_coze"and dev_type != "jswm" and dev_type != 'jswm_BOX' and dev_type != "7PIN_BK": + if dev_type != "7PIN" and dev_type != "7PIN_1_5" and dev_type != "7PIN_coze"and dev_type != "jswm" and dev_type != 'jswm_BOX' and dev_type != "7PIN_BK": self.power_on_tone = None if self.power_on_tone == None: if dev_type == "G10": @@ -2564,7 +2589,7 @@ class AI_VC(Abstract): self.vad_silence = EventMesh.publish("get_storage_config","vad_silence")#语速配置 if self.vad_silence == None: - if dev_type == "7PIN" or dev_type == "7PIN_coze": + if dev_type == "7PIN" or dev_type == "7PIN_1_5" or dev_type == "7PIN_coze": self.vad_silence = 200 else: self.vad_silence = 300 @@ -2827,6 +2852,7 @@ class AI_VC(Abstract): self.VC_stop_play_audio_flag = 0 self.VC_satrt_kws_flag = 0 self.session_id = "" + self.stop_voice_timer=osTimer() EventMesh.subscribe("AI_key_press", self.AI_key_press) EventMesh.subscribe("BT_AI_key_press", self.BT_AI_key_press) EventMesh.subscribe("stop_AI_record", self.stop_AI_record) @@ -2843,6 +2869,8 @@ class AI_VC(Abstract): EventMesh.subscribe("SET_TTS_VOLUME", self.set_tts_volume) EventMesh.subscribe("set_VC_stop_play_audio_flag", self.set_VC_stop_play_audio_flag) EventMesh.subscribe("set_yuyinaudio_flag",self.set_yuyinaudio_flag) + EventMesh.subscribe("get_yuyinaudio_flag",self.get_yuyinaudio_flag) + EventMesh.subscribe("exit_voice_message_mode",self.exit_voice_message_mode) #超时未退出语音留言模式 EventMesh.subscribe("get_audio_play_state",self.get_audio_play_state) # EventMesh.subscribe("chenggong_tone",self.chenggong_tone) @@ -2856,7 +2884,7 @@ class AI_VC(Abstract): self.outbound_attributess_provider = "volcengine" self.inbound_attributess_provider = EventMesh.publish("get_storage_config","inbound_attributess_provider")#tts服务选择 if self.inbound_attributess_provider == None: - if dev_type == "7PIN" or dev_type == "7PIN_coze" : + if dev_type == "7PIN" or dev_type == "7PIN_1_5" or dev_type == "7PIN_coze" : self.inbound_attributess_provider = "xun-fei" else: self.inbound_attributess_provider = "volcengine" @@ -2870,7 +2898,10 @@ class AI_VC(Abstract): except Exception as e: usys.print_exception(e) try: - bt_ota_flag = self.ai_OTA.bt_ota()#先检查蓝牙是否要升级 + bt_ota_flag=0 + if dev_type == "7PIN_1_5": + bt_ota_flag = self.ai_OTA.bt_ota()#先检查蓝牙是否要升级 + cat1_ota_flag = self.ai_OTA.min_sys_ota() if bt_ota_flag==1 or cat1_ota_flag == 1: #if 0: @@ -2979,7 +3010,7 @@ class AI_VC(Abstract): url=None if dev_type == "7PIN_BK_EU":#英文小瑞 url = "http://dmp-global.raisound.com/bz-api/dev/config/{}".format(modem.getDevImei()) - elif dev_type == "7PIN" or dev_type == "7PIN_coze":#柒牌 + elif dev_type == "7PIN" or dev_type == "7PIN_1_5" or dev_type == "7PIN_coze":#柒牌 url = "http://ota.qipai.com/bz-cmp-api/api/config/{}".format(modem.getDevImei()) else: url = "http://dmp.raisound.com/bz-api/dev/config/{}".format(modem.getDevImei()) @@ -3052,16 +3083,25 @@ class AI_VC(Abstract): else: self.aud.setVolume(self.VC_TTS_volume //10) pass + def get_yuyinaudio_flag(self, event=None, msg = None): + return self.voice_flag + def set_yuyinaudio_flag(self, event=None, msg = None): self.voice_flag=0 def get_audio_play_state(self, event=None, msg = None): return self.audio_play_state - + def exit_voice_message_mode(self, event=None, msg = None): + if self.voice_flag == 1: #还是为1就提示已退出语音留言模式 + self.voice_flag=0 + exit_tts ="已退出语音留言模式" + EventMesh.publish("play_tts",[exit_tts,1]) + pass def AI_key_press(self, event=None, msg = None):#按键按下 EventMesh.publish(constants.EVENT.SYSTEM_UP)#唤醒休眠 if EventMesh.publish("get_sos_flag")== 1: return if self.voice_flag == 1: #语音留言模式 + self.stop_voice_timer.stop() #关闭语音留言模式定时器 # EventMesh.publish("stop_AI_record") self.Close() EventMesh.publish("open_led_green") @@ -3073,11 +3113,11 @@ class AI_VC(Abstract): self.get_config_timer_count = 0 self.key_state = 1 if PRESS_AUDIO_MODE == 1: - if dev_type == "7PIN": + if dev_type == "7PIN" or dev_type == "7PIN_1_5": self.aud.aud_tone_play(10,200)#播放按键音 self.Close() if PRESS_AUDIO_MODE == 0: - if dev_type == "7PIN": + if dev_type == "7PIN" or dev_type == "7PIN_1_5": self.chenggong_tone() # if dev_type == "7PIN": # self.chenggong_tone() @@ -3106,6 +3146,7 @@ class AI_VC(Abstract): return if self.voice_flag == 1: #语音留言模式 # EventMesh.publish("stop_AI_record") + self.stop_voice_timer.stop() #关闭语音留言模式定时器 self.Close() EventMesh.publish("open_led_green") EventMesh.publish("start_voice_record",2)#停止静默录音 @@ -3116,11 +3157,11 @@ class AI_VC(Abstract): self.get_config_timer_count = 0 self.key_state = 1 if PRESS_AUDIO_MODE == 1: - if dev_type == "7PIN": + if dev_type == "7PIN" or dev_type == "7PIN_1_5": self.aud.aud_tone_play(10,200)#播放按键音 self.Close() if PRESS_AUDIO_MODE == 0: - if dev_type == "7PIN": + if dev_type == "7PIN" or dev_type == "7PIN_1_5": self.chenggong_tone() if self.VC_mode == 1: #长按对话模式 接收到蓝牙耳机按键事件 @@ -3165,12 +3206,14 @@ class AI_VC(Abstract): count+=1 utime.sleep_ms(500) - + def exit_voice_message_timer(self,*argc): + EventMesh.publish("exit_voice_message_mode") def AI_key_release(self, event=None, msg=None):#按键弹起 print("AI_key_release123") self.key_state = 0 if self.voice_flag == 1: + self.stop_voice_timer.stop() self.voice_flag=0 if EventMesh.publish("GET_USB_STATE") == 0: EventMesh.publish("close_led") @@ -3872,7 +3915,7 @@ class AI_VC(Abstract): self.AI_TTS_str = "" else: #开始上传语音 - if dev_type != "7PIN_coze" and dev_type != "7PIN" : + if dev_type != "7PIN_coze" and dev_type != "7PIN" and dev_type != "7PIN_1_5": self.chenggong_tone() if self.VC_mode == 0 : self.VC_record_state_flag =2 @@ -4624,7 +4667,8 @@ class AI_VC(Abstract): self.voice_flag = 1 self.AI_TTS_str = "已进入语音留言模式,长按按钮开始录音,松开按钮结束" self.Close_flag = 1 - + self.stop_voice_timer.stop() #关闭语音留言模式定时器 + self.stop_voice_timer.start(30*1000,0,self.exit_voice_message_timer) print("语音留言!!!!!!!!!!") return 0 if text.find("开广播") != -1 or text.find("开蓝牙广播") != -1: @@ -4670,7 +4714,7 @@ class AI_VC(Abstract): return 0 if len(text)<16 and (text.find("再见") != -1 or text.find("拜拜") != -1 or text.find("关闭对话") != -1): #EventMesh.publish("publish_AI_btnInfo",{"func":self.Close}) - if dev_type != "7PIN" and dev_type != "7PIN_coze":#柒牌 + if dev_type != "7PIN" and dev_type != "7PIN_coze" and dev_type != "7PIN_1_5":#柒牌 self.AI_TTS_str = "好嘞,再见,我们下次再聊" self.Close_flag = 1 return 0 @@ -4679,7 +4723,7 @@ class AI_VC(Abstract): #EventMesh.publish("sleep_BT")#休眠蓝牙 return 1 if len(text)<12 and (text.find("关机") != -1 ): - if dev_type == "7PIN" or dev_type == "7PIN_coze":#柒牌 + if dev_type == "7PIN" or dev_type == "7PIN_coze" or dev_type == "7PIN_1_5":#柒牌 EventMesh.publish("publish_AI_btnInfo",{"func":self.Close}) #EventMesh.publish("sleep_BT")#休眠蓝牙 return 1 @@ -5049,7 +5093,7 @@ class AI_VC(Abstract): json_data["payload"]["dialog_attributes"]["cfg"]["bot_option"]["bot_id"]="7490852493640384538"#慈善会 json_data["payload"]["dialog_attributes"]["cfg"]["bot_option"]["use_workflow"]=False json_data["payload"]["dialog_attributes"]["cfg"]["bot_option"]["workflow_id"]="" - elif dev_type == "7PIN" :#柒牌 + elif dev_type == "7PIN" or dev_type == "7PIN_1_5" :#柒牌 json_data["payload"]["dialog_attributes"]["cfg"]["bot_option"]["bot_id"]=""# json_data["payload"]["dialog_attributes"]["cfg"]["bot_option"]["workflow_id"]="" #json_data["payload"]["inbound_attributes"]["vad_silence"] = 1000 @@ -5186,11 +5230,11 @@ class AI_VC(Abstract): elif EventMesh.publish("get_voice_record_mode") == 1: #静默录音需要打断 EventMesh.publish("stop_voice_record")#停止静默录音 if PRESS_AUDIO_MODE == 1: - if dev_type == "7PIN": + if dev_type == "7PIN" or dev_type == "7PIN_1_5" : self.aud.aud_tone_play(10,200) self.Close() if PRESS_AUDIO_MODE == 0: - if dev_type == "7PIN": + if dev_type == "7PIN" or dev_type == "7PIN_1_5": self.chenggong_tone() # if dev_type == "7PIN" : # self.aud.aud_tone_play(10,400)#播放按键音 @@ -5200,7 +5244,7 @@ class AI_VC(Abstract): self.AI_ASR_str_tmp = "" self.VC_state = VC_State_None self.VC_Speech_End() - self.VC_Speech_Start() + self.VC_Speech_Start() self.AI_VC_start() def set_vad_silence(self,event = None,msg= None): diff --git a/2.sdk/project/7PIN_1_5/sdk/services/microPython/ports/quectel/core/protocol.py b/2.sdk/project/7PIN_1_5/sdk/services/microPython/ports/quectel/core/protocol.py index f86b5f41..38f470e9 100644 --- a/2.sdk/project/7PIN_1_5/sdk/services/microPython/ports/quectel/core/protocol.py +++ b/2.sdk/project/7PIN_1_5/sdk/services/microPython/ports/quectel/core/protocol.py @@ -1058,6 +1058,13 @@ class sosInfoCallManager(Abstract): pass #再次拨打 def set_sos_info_call(self,event,msg): + if EventMesh.publish("get_yuyinaudio_flag") == 1 or EventMesh.publish("get_voice_record_mode") != 0: #语言留言模式不允许拨打电话 + self.call_state = 0 + self.num=0 #不管有没有拨打sos都清除 + self.num_len = 0 + self.sos_flag = 0 + self.phone110112_flag=0 + return if sim.getStatus() != 1:#网络正常 tts_str = "无SIM卡" EventMesh.publish("stop_voice_record") #电话优先级最高 diff --git a/2.sdk/project/7PIN_1_5/sdk/services/microPython/ports/quectel/core/voice_record.py b/2.sdk/project/7PIN_1_5/sdk/services/microPython/ports/quectel/core/voice_record.py index 88100594..8d755d9f 100644 --- a/2.sdk/project/7PIN_1_5/sdk/services/microPython/ports/quectel/core/voice_record.py +++ b/2.sdk/project/7PIN_1_5/sdk/services/microPython/ports/quectel/core/voice_record.py @@ -65,6 +65,8 @@ class VOICE_RECORD(Abstract): #静默录音 def get_voice_record_mode(self,event,msg): return self.voice_mode def start_voice_record(self,event,msg): + if msg == 0: #不能传0 + return -1 if EventMesh.publish("get_sos_flag") == 1: return -1 get_VC_satrt_flag = EventMesh.publish("get_VC_satrt_flag")