K5更新sdk,新增通话静音功能
authorp15692025051 <846603105@qq.com>
Fri, 18 Aug 2023 11:56:35 +0000 (19:56 +0800)
committerp15692025051 <846603105@qq.com>
Fri, 18 Aug 2023 11:56:35 +0000 (19:56 +0800)
2.sdk/Helios_SDK/services/microPython/ports/quectel/core/source/modsim.c
2.sdk/Helios_SDK/services/microPython/ports/quectel/core/source/modvoicecall.c
2.sdk/Helios_SDK/system/hal/helios_audio.h
2.sdk/Helios_SDK/system/network/helios_sim.h
2.sdk/project/K5/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_ALIPAY/images/DBG.7z
2.sdk/project/K5/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_ALIPAY/images/firmware_base_release_pack.zip
2.sdk/project/K5/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_ALIPAY/libraries/libHeliosAPI.lib
2.sdk/project/K5/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_ALIPAY/libraries/ql_common_api.lib

index dfef4a4..a0b71bc 100644 (file)
@@ -31,9 +31,13 @@ int _get_current_simid(void)
 {
     int cur_simid = 0;
     
-    #if defined(PLAT_ASR_1606)
-        cur_simid = Helios_SIM_Get_Current_Simid();
-    #endif
+#if defined(PLAT_ASR_1606) || defined(PLAT_EIGEN) //|| defined(PLAT_ASR) 
+       uint8_t sim_id = 0;
+       Helios_SIM_GetCurrentSimid(&sim_id);
+       cur_simid = sim_id;
+#elif defined(PLAT_Unisoc)
+       cur_simid = 0;
+#endif
 
        if(cur_simid < 0)
        {
@@ -665,24 +669,15 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(qpy_sim_set_switchcard_cb_obj, qpy_sim_set_swit
 STATIC mp_obj_t qpy_sim_switch_card(mp_obj_t sim_id)
 {
     int simid = mp_obj_get_int(sim_id);
-       int ret = Helios_SIM_Switch_Card(simid, switch_sim_done_callback);
-       if (ret == HELIOS_SIM_GENERIC_FAILURE)
-       {
-               ret = -1;
-       }
-    else if (ret == HELIOS_SIM_NOT_SUPPORT)
-       {
-               return mp_obj_new_str("NOT SUPPORT", strlen("NOT SUPPORT"));
-       }
-       
+       int ret = Helios_SIM_SwitchCard(simid, switch_sim_done_callback);
        return mp_obj_new_int(ret);
 }
 STATIC MP_DEFINE_CONST_FUN_OBJ_1(qpy_sim_switch_card_obj, qpy_sim_switch_card);
 
 STATIC mp_obj_t qpy_sim_get_current_simid()
 {
-       int simid = Helios_SIM_Get_Current_Simid();
-       
+       uint8_t simid = HELIOS_SIM_0;
+       Helios_SIM_GetCurrentSimid(&simid);
        return mp_obj_new_int(simid);
 }
 STATIC MP_DEFINE_CONST_FUN_OBJ_0(qpy_sim_get_current_simid_obj, qpy_sim_get_current_simid);
index 824989c..3808b50 100644 (file)
@@ -915,6 +915,36 @@ STATIC mp_obj_t qpy_module_voicecall_getAutocancel(void)
 STATIC MP_DEFINE_CONST_FUN_OBJ_0(qpy_module_voicecall_getAutocancel_obj, qpy_module_voicecall_getAutocancel);
 #endif
 
+#if defined(PLAT_ASR_1606)
+STATIC mp_obj_t qpy_module_voicecall_mute(size_t n_args, const mp_obj_t *args)
+{
+       int dir = mp_obj_get_int(args[0]);
+       int mute = mp_obj_get_int(args[1]);
+       int time = 0;
+
+
+       if(n_args == 3) {
+               time = mp_obj_get_int(args[2]);
+       }
+
+       if(dir < HELIOS_TWO_WAY || dir > HELIOS_MODULE_TO_PHONE || (mute != 0 && mute != 1)) {
+               mp_raise_ValueError("Incoming parameter error, please check the parameters. dir[0,2], mute[0,1]");
+       }
+
+    int ret = Helios_mute_voicecall(dir, mute, time);
+       if(ret != 0) {
+               QPY_MODVOICECALL_LOG("error[%d]!\n",ret);
+               ret = -1;
+       }
+       
+       return mp_obj_new_int(ret);
+}
+//STATIC MP_DEFINE_CONST_FUN_OBJ_3(qpy_module_voicecall_mute_obj, qpy_module_voicecall_mute);
+STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(qpy_module_voicecall_mute_obj, 2, 3, qpy_module_voicecall_mute);
+#endif
+
+
+
 STATIC const mp_rom_map_elem_t mp_module_voicecall_globals_table[] = {
     { MP_ROM_QSTR(MP_QSTR___name__),                MP_ROM_QSTR(MP_QSTR_voiceCall) },
     
@@ -950,7 +980,9 @@ STATIC const mp_rom_map_elem_t mp_module_voicecall_globals_table[] = {
 #endif
     { MP_ROM_QSTR(MP_QSTR_setWaittime),          MP_ROM_PTR(&qpy_module_voicecall_set_waittime_obj) },
 #endif
-
+#if defined(PLAT_ASR_1606)
+       { MP_ROM_QSTR(MP_QSTR_mute),             MP_ROM_PTR(&qpy_module_voicecall_mute_obj) },
+#endif
 #if defined(PLAT_ASR_1803s)
     { MP_ROM_QSTR(MP_QSTR_setAutoCancel),          MP_ROM_PTR(&qpy_module_voicecall_setAutocancel_obj) },
     { MP_ROM_QSTR(MP_QSTR_getAutoCancelStatus),          MP_ROM_PTR(&qpy_module_voicecall_getAutocancel_obj) },
index 4b18105..2511fab 100644 (file)
@@ -119,6 +119,14 @@ typedef enum
        HELIOS_RECORD_STREAM,
 }Helios_AudRecordDirect;
 
+typedef enum
+{
+       HELIOS_TWO_WAY,
+       HELIOS_PHONE_TO_MODULE,
+       HELIOS_MODULE_TO_PHONE,
+}Helios_Mute_VoiceCall;
+
+
 
 typedef enum
 {
@@ -757,7 +765,7 @@ typedef void (*ydwl_tts_cb_type)(int id, YDWL_TTS_ENVENT_E status);
 void Helios_ydwl_tts_init(ydwl_tts_cb_type usr_cb);
 void Helios_ydwl_tts_play(const char* string, unsigned int len);
 #endif
-
+int Helios_mute_voicecall(Helios_Mute_VoiceCall direction, unsigned char mute, unsigned char time);
 #ifdef __cplusplus
 } /*"C" */
 #endif
index 42613e3..94f94e3 100644 (file)
@@ -351,14 +351,13 @@ int Helios_SIM_PINChange(uint8_t sim_id, Helios_SIMChangePinInfoStruct *info);
 //mia.zhong @20211008
 #if defined(PLAT_ASR)
 int Helios_SIM_GenericAccess(uint8_t sim_id, Helios_SIMGenericAccesStruct *info);
-HELIOS_SIM_ERRORCODE Helios_SIM_Get_Current_Simid(HELIOS_SimID_ex helios_simid);
 #endif
-#if defined(PLAT_ASR_1606) || defined(PLAT_ASR) || defined(PLAT_EIGEN)
-HELIOS_SIM_ERRORCODE Helios_SIM_Switch_Card(uint8_t sim_id, void *cb);
-#endif
-#if defined(PLAT_ASR_1606) || defined(PLAT_EIGEN)
-HELIOS_SimID_ex Helios_SIM_Get_Current_Simid(void);
+
+#if defined(PLAT_ASR_1606) || defined(PLAT_EIGEN) || defined(PLAT_Unisoc) //|| defined(PLAT_ASR) 
+int Helios_SIM_SwitchCard(uint8_t sim_id, void *cb);
+int Helios_SIM_GetCurrentSimid(uint8_t *sim_id);
 #endif
+
 /*-----------------------------------------------------------------------*/
 #ifdef __cplusplus
 }
index 554ec3f..9b1712e 100644 (file)
Binary files a/2.sdk/project/K5/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_ALIPAY/images/DBG.7z and b/2.sdk/project/K5/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_ALIPAY/images/DBG.7z differ
index a57bbb7..60c26c0 100644 (file)
Binary files a/2.sdk/project/K5/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_ALIPAY/images/firmware_base_release_pack.zip and b/2.sdk/project/K5/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_ALIPAY/images/firmware_base_release_pack.zip differ
index 29cbb79..1c4263b 100644 (file)
Binary files a/2.sdk/project/K5/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_ALIPAY/libraries/libHeliosAPI.lib and b/2.sdk/project/K5/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_ALIPAY/libraries/libHeliosAPI.lib differ
index ba7beb3..2c7119b 100644 (file)
Binary files a/2.sdk/project/K5/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_ALIPAY/libraries/ql_common_api.lib and b/2.sdk/project/K5/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_ALIPAY/libraries/ql_common_api.lib differ