增加cat1 HFPAG服务
authorhcj <1224667075@qq.com>
Fri, 5 Sep 2025 09:25:00 +0000 (17:25 +0800)
committerhcj <1224667075@qq.com>
Fri, 5 Sep 2025 09:25:00 +0000 (17:25 +0800)
26 files changed:
cat1modem/src/cat1Service.py
code/sdk/application/wearable/fd230/nativeapp/nativeui/assistant/src/AssistantModel.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/bluetooth/src/BluetoothDeviceCaseListAdapter.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/bluetooth/src/BluetoothItemView.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/bluetooth/src/BluetoothModel.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/callerlog/src/CallerLogModel.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/makephone/src/CallingView.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/phone/src/DialingMethodPresenter.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/phone/src/MainPhoneView.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/phoneservice/src/PhoneAGService.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/phoneservice/src/PhoneAudio.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/phoneservice/src/PhoneService.cpp
code/sdk/application/wearable/fd230/service/msg_center/src/msg_center_customer.cpp
code/sdk/application/wearable/ln/nativeapp/nativeui/bluetooth/src/BluetoothDeviceCaseListAdapter.cpp
code/sdk/application/wearable/ln/nativeapp/nativeui/bluetooth/src/BluetoothItemView.cpp
code/sdk/application/wearable/ln/nativeapp/nativeui/bluetooth/src/BluetoothModel.cpp
code/sdk/application/wearable/ln/nativeapp/nativeui/callerlog/src/CallerLogModel.cpp
code/sdk/application/wearable/ln/nativeapp/nativeui/makephone/src/CallingView.cpp
code/sdk/application/wearable/ln/nativeapp/nativeui/phoneservice/src/PhoneService.cpp
code/sdk/middleware/services/media/foundation/sample/wrapper/audio_manager_c_wrapper.cpp
code/sdk/middleware/services/media/foundation/sample/wrapper/voice_call_volte_bluetooth_wrapper.cpp
code/sdk/zhihui/4g/cat1Service/Service/cat1_ctl.c
code/sdk/zhihui/4g/cat1Service/Service/cat1_server.c
code/sdk/zhihui/4g/cat1Service/include/cat1_porting.h
code/sdk/zhihui/4gTest/cat1_porting.c
code/sdk/zhihui/utils/custom_utils.h

index 9c4e630..7fc79b5 100644 (file)
@@ -916,7 +916,7 @@ class Cat1Service:
                 clog.info("Socket_SEND_Thread data:{} {}".format(data[0],data[1]))
                 count=20
                 
-                while count & self.ack_sem :
+                while count and self.ack_sem :
                     utime.sleep_ms(1)
                     count=count-1
                     # if data[2]:
@@ -927,7 +927,7 @@ class Cat1Service:
                     clog.info("Socket_SEND_Thread  while data:{} {}".format(data[0],data[1]))
                 
                 if data:
-                        clog.info("data ok!!")
+                        clog.info("data ok!! {} {}".format(self.ack_sem,count))
                 else:
                         clog.error("data error!!")
             except Exception :
index 4f0deee..3b5135c 100644 (file)
@@ -20,7 +20,7 @@
 #endif
 
 #ifdef SUPPORT_PHONE_SERVICE
-#include "PhoneService.h"
+#include "phoneservice/include/PhoneService.h"
 #include "phoneservice/include/PhoneServiceC.h"
 #endif
 
@@ -166,8 +166,7 @@ bool AssistantModel::GetHFPStatus(void) {
 bool AssistantModel::StartAssistant(void) {
 #ifdef SUPPORT_PHONE_SERVICE
   if (uapi_open_voice_recognition() == 0) {
-    WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "uapi_open_voice_recognition is
-    ok");
+    WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "uapi_open_voice_recognition is ok");
     //成功开启语音助手
     uapi_dev_runtime_set_voice_status(1);
     return true;
index 074d4c4..37ef661 100644 (file)
@@ -16,7 +16,7 @@
 #include "custom_utils.h"
 #include "notification_manager.h"
 
-#ifdef SUPPORT_PHONE_SERVICE
+#ifdef SUPPORT_CAT1_HFP_AG_SERV
 #include "phoneservice/include/PhoneAGService.h"
 #endif
 
@@ -62,7 +62,7 @@ namespace OHOS
                 jumpView->ChangeView(JumpView::BluetoothJumpViewNum::BLUETOOTHDEVICELISTVIEW,
                                      JumpView::BluetoothJumpViewNum::BLUETOOTHEOPTIONSVIEW);
             }
-            #ifdef  SUPPORT_BT_SERVICE
+            #ifdef  SUPPORT_CAT1_HFP_AG_SERV
             else if (BluetoothModel::GetInstance()->GetBluetoothCalleridStatus() == CALLERSETTING)
             {
                 MainBluetoothView *mainBluetoothView = MainBluetoothView::GetInstance();
index 1562b62..0250e22 100644 (file)
@@ -15,7 +15,7 @@
 #include "custom_utils.h"\r
 #include "notification_manager.h"\r
 \r
-#ifdef SUPPORT_PHONE_SERVICE\r
+#ifdef SUPPORT_CAT1_HFP_AG_SERV\r
 #include "phoneservice/include/PhoneAGService.h"\r
 #endif\r
 \r
@@ -181,7 +181,7 @@ namespace OHOS
                   if(OHOS::CallerLogModel::GetInstance()->GetCallSource() == OHOS::CallerLogModel::CallSourceCat1\r
                 && OHOS::NotificationManager::GetInstance()->GetWatchCallStatus())\r
                 {\r
-                    #ifdef SUPPORT_BT_SERVICE\r
+                    #ifdef SUPPORT_CAT1_HFP_AG_SERV\r
                     bool SCOConnected = headset_SCO_Is_connect_extend( (bd_addr_t *)&infoData.addr);\r
                     #else\r
                     bool SCOConnected = false;\r
index a4d116f..42ac17a 100644 (file)
 #include "lwip_driver_adapter.h"\r
 #endif\r
 \r
+#ifdef SUPPORT_CAT1_HFP_AG_SERV\r
+#include "phoneservice/include/PhoneAGService.h"\r
+#endif\r
+\r
 #ifdef SUPPORT_BLE_SERVICE\r
 #include <bleEvent.h>\r
 #include "bleService.h"\r
@@ -70,9 +74,6 @@
 #include "vibrator_service.h"\r
 #include "ConfigModel.h"\r
 \r
-#ifdef SUPPORT_PHONE_SERVICE\r
-#include "phoneservice/include/PhoneAGService.h"\r
-#endif\r
 \r
 #include "custom_save_runtime.h"\r
 #include "bluetooth/include/BluetoothHeadsetEvent.h"\r
@@ -1305,15 +1306,13 @@ static void A2dpSrcConnectstateChanged(bd_addr_t *bdAddr, int connState)
         PhoneAudioManagerSetDeviceConnState(OUT_BLUETOOTH_A2DP, AUDIO_DEVICE_CONNECTED);\r
         GraphicService::GetInstance()->PostGraphicEvent(std::bind(ACLConnectionSuss, *bdAddr));\r
 \r
-        #ifdef SUPPORT_BLE_SERVICE\r
-        // SendMsgToUIService(EARPHONE_CONNECTED_TO_UI, 0, nullptr, 0);\r
+        #ifdef SUPPORT_CAT1_HFP_AG_SERV\r
+        SendMsgToUIService(EARPHONE_CONNECTED_TO_UI, 0, nullptr, 0);\r
       \r
-\r
-\r
          uapi_dev_runtime_set_earphone_connect_stat(1);\r
          uapi_save_runtime_log(RUNTIME_LOG_BR_CONNECT_A2DP_HEADSET);\r
-        // if(headset_Is_connect() == false)\r
-        //     do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CONNECT_AG, nullptr, 0);\r
+        if(headset_Is_connect() == false)\r
+        do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CONNECT_AG, nullptr, 0);\r
 \r
         #endif\r
          \r
index a3a3040..eed58da 100644 (file)
@@ -36,9 +36,9 @@
 #endif
 #include "alarm/include/AlarmClockModel.h"
 
-// #ifdef SUPPORT_PHONE_SERVICE
+#ifdef SUPPORT_CAT1_HFP_AG_SERV
 #include "phoneservice/include/PhoneAGService.h"
-// #endif
+#endif
 
 #include "custom_save_runtime.h"
 
@@ -193,7 +193,7 @@ void StatusReset(void)
             #ifdef SUPPORT_CAT1_HFP_AG_SERV
             if(headset_Is_connect())
             {
-                // cat1_ag_send_call_event(TOPIC_EVENT_CAT1_CALLENDED,NULL);
+                cat1_ag_send_call_event(TOPIC_EVENT_CAT1_CALLENDED,NULL);
             }
             #endif
         }
@@ -264,11 +264,14 @@ static void CallTimerCallbackProc(int data)
                 }
                 if(headset_SCO_Is_connect()==true && cat1_api_get_cat1_volte_voice_state()!=2)
                 {
-                    if(cat1_api_get_cat1_volte_voice_state()==2)
+                    if(cat1_api_get_cat1_volte_voice_state()==1)
                     {
                         do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT1_AUDIO_STOP, nullptr, 0);
                     }
-                    do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT_HFP_SCO_AUDIO_START, nullptr, 0);
+                    else
+                    {   
+                        do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT_HFP_SCO_AUDIO_START, nullptr, 0);
+                    }
                 }
             }
             #endif
index 8f84625..ef0a1fa 100644 (file)
@@ -99,7 +99,9 @@ namespace OHOS
                     DialingMethodView::GetInstance()->fail_Dial_show(1);
                 }
                 else
-                DialCall((unsigned char *)get_address_number(),strlen(get_address_number()));
+                {
+                    DialCall((unsigned char *)get_address_number(),strlen(get_address_number()));
+                }
             }
             else
             {
index da464a5..9ce55b6 100644 (file)
@@ -290,6 +290,7 @@ namespace OHOS
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CallLOGListitemView::SetItemInfo");
         if(data==NULL)
         {
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CallLOGListitemView::data is NULL");
             return;
         }
         
index 84a24fa..389b929 100644 (file)
@@ -188,7 +188,7 @@ void HFP_SCO_STATE_DISCONNECTEDPro(void)
 static void sample_hfp_ag_sco_conn_state_changed_callback(const bd_addr_t *bd_addr, hfp_sco_connect_state_t state)
 {
     // sample_hfp_ag_print_addr(bd_addr);
-    WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"state: %d\n", state);
+    WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"sample_hfp_ag_sco_conn_state_changed_callback state: %d\n", state);
     osal_kthread_handler task_body = NULL;
     switch (state) {
         case HFP_SCO_STATE_CONNECTING:
index e021860..8c71d74 100644 (file)
@@ -157,8 +157,9 @@ int32_t PhoneAudioSetMicMuteCat1(bool isMute)
     {
         return 0;
     }
+   
+    cat1_api_set_MicMute_volte_voice(isMute);
     #endif
-    ret=AudioStreamOutSetMute(isMute);
     WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[AudioStreamOutSetMute] end! ret = %d", ret);
     return 0;
 
index b5a4bc7..3f19185 100644 (file)
@@ -42,7 +42,9 @@
 #include "gfx_utils/mem_api.h"
 #include "ConfigModelC.h"
 #include "UiConfig.h"
+#ifdef SUPPORT_CAT1_HFP_AG_SERV
 #include "phoneservice/include/PhoneAGService.h"
+#endif
 #include "cmath"
 #include "phone_crt.h"
 
@@ -1788,7 +1790,7 @@ static void RegisterHfpHfCallbacks(void)
 
 void PhoneServiceInit(void)
 {
-    WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[PhoneServiceInit] start");
+    WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[PhoneServiceInit] start");
     g_scoFlag = HFP_SCO_STATE_DISCONNECTED;
     AudioInit();
     InitMutex();
@@ -1801,10 +1803,10 @@ void PhoneServiceInit(void)
     RegisterHfpHfCallbacks();
 //AG 服务注册
 #ifdef SUPPORT_CAT1_HFP_AG_SERV
-    // hfp_ag_reg_callback();
+    hfp_ag_reg_callback();
 #endif
     
-    WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[PhoneServiceInit] end");
+    WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[PhoneServiceInit] end");
 }
 
 // 手表主动拨打电话
index 6237663..27e0e86 100644 (file)
 #endif
 
 #ifdef FD230
+
+#ifdef SUPPORT_CAT1_HFP_AG_SERV
+#include "phoneservice/include/PhoneAGService.h"
+#endif
+
 #include "ConfigModel.h"
 #include "PlayersModelC.h"
 #include "PlayersModel.h"
@@ -741,6 +746,7 @@ void MsgCenterNotifyCat1CallConnectedProc(const Topic topic, Request* req)
             }
             else
             {
+                if(cat1_api_get_cat1_volte_voice_state()==0)
                 do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT_HFP_SCO_AUDIO_START, nullptr, 0);
                 WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "headset_Is_connect is false");
             }
@@ -802,6 +808,7 @@ void MsgCenterNotifyCat1dialProc(const Topic topic, Request* req)
         
             if(headset_SCO_Is_connect())
             {
+                if(cat1_api_get_cat1_volte_voice_state()==0)
                 do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_CAT_HFP_SCO_AUDIO_START, nullptr, 0);
             }
         }
index 1562b62..547206b 100644 (file)
@@ -15,7 +15,7 @@
 #include "custom_utils.h"\r
 #include "notification_manager.h"\r
 \r
-#ifdef SUPPORT_PHONE_SERVICE\r
+#ifdef SUPPORT_CAT1_HFP_AG_SERV\r
 #include "phoneservice/include/PhoneAGService.h"\r
 #endif\r
 \r
index a4d116f..df79aca 100644 (file)
@@ -70,7 +70,7 @@
 #include "vibrator_service.h"\r
 #include "ConfigModel.h"\r
 \r
-#ifdef SUPPORT_PHONE_SERVICE\r
+#ifdef SUPPORT_CAT1_HFP_AG_SERV\r
 #include "phoneservice/include/PhoneAGService.h"\r
 #endif\r
 \r
index eb98835..2ea2b5d 100644 (file)
@@ -33,7 +33,7 @@
 #endif
 #include "alarm/include/AlarmClockModel.h"
 
-#ifdef SUPPORT_PHONE_SERVICE
+#ifdef SUPPORT_CAT1_HFP_AG_SERV
 #include "phoneservice/include/PhoneAGService.h"
 #endif
 
index 5e530a7..140821b 100644 (file)
 #include "gfx_utils/mem_api.h"
 #include "ConfigModelC.h"
 #include "UiConfig.h"
+
+#ifdef SUPPORT_CAT1_HFP_AG_SERV
 #include "phoneservice/include/PhoneAGService.h"
+#endif
+
 #include "cmath"
 #ifdef __cplusplus
 extern "C" {
index a804a4f..7783805 100644 (file)
@@ -223,9 +223,9 @@ int32_t AudioStreamInObtainBuffer(uint8_t *data, uint32_t *size)
 int32_t AudioStreamInSetBitRate(uint32_t bitrate)
 {
     std::string str("setbitrate = " + std::to_string(bitrate));
-    if (g_streamIn == nullptr) {\r
+    if (g_streamIn == nullptr) {
         ALOGE("audio stream in handle is NUll!");
-        return AUDIO_ERROR;\r
+        return AUDIO_ERROR;
     }
     int32_t ret = g_streamIn->SetParam(str.c_str(), str.size());
     if (ret != AUDIO_SUCCESS) {
@@ -279,14 +279,21 @@ int32_t AudioStreamOutInit(AudioRendererConfig renderConfig)
 
 int32_t AudioStreamOutSetMute(bool mute)
 {
-    int32_t ret = g_streamOut->SetMute(mute);
-    if (ret != AUDIO_SUCCESS) {
-        ALOGE("audio stream out set mute failed 0x%x", ret);
-        return AUDIO_ERROR;
-    }
+    if(g_streamOut)
+    {
+        int32_t ret = g_streamOut->SetMute(mute);
+        if (ret != AUDIO_SUCCESS) {
+            ALOGE("audio stream out set mute failed 0x%x", ret);
+            return AUDIO_ERROR;
+        }
+        
 
-    ALOGD("success");
-    return AUDIO_SUCCESS;
+        ALOGD("success");
+        return AUDIO_SUCCESS;
+    }
+    ALOGD("g_streamOut is null");
+    return AUDIO_ERROR;
+  
 }
 
 int32_t AudioManagerSetSeaEnable(bool enable)
@@ -443,9 +450,9 @@ int32_t AudioManagerA2dpSinkSetAefParam(int32_t effectType, const char *param, u
         ALOGE("aef param null");
         return AUDIO_ERROR;
     }
-    if (g_a2dpCtx == nullptr || g_a2dpCtx->a2dpAsohandle == nullptr) {\r
+    if (g_a2dpCtx == nullptr || g_a2dpCtx->a2dpAsohandle == nullptr) {
         ALOGE("aso handle is null!");
-        return AUDIO_ERROR;\r
+        return AUDIO_ERROR;
     }
     char *aefBuf = (char *)malloc(AEF_BUFFER_SIZE);
     if (aefBuf == nullptr) {
@@ -486,10 +493,10 @@ int32_t AudioManagerA2dpSinkSetAefEnable(int32_t effectType, bool enable)
         ALOGE("sprintf_s failed");
         return AUDIO_ERROR;
     }
-    if (g_a2dpCtx == nullptr || g_a2dpCtx->a2dpAsohandle == nullptr) {\r
-        ALOGE("aso handle is null!");\r
-        return AUDIO_ERROR;\r
-    }\r
+    if (g_a2dpCtx == nullptr || g_a2dpCtx->a2dpAsohandle == nullptr) {
+        ALOGE("aso handle is null!");
+        return AUDIO_ERROR;
+    }
     ret = g_a2dpCtx->a2dpAsohandle->SetParam(buf, BUFFER_SIZE);
     if (ret != AUDIO_SUCCESS) {
         ALOGE("set aso param failed");
index 1cf10cd..f969c02 100644 (file)
@@ -397,14 +397,14 @@ static void *VoiceCallVolteThread(void *priv)
         MEDIA_ERR_LOG("release audio focus failed");
         return nullptr;
     }
-
+        
     return nullptr;
 }
 
 static int32_t StartVoiceCall(const char **param)
 {
     MediaMutexLock(g_voiceCallVolteContextMutex);
-    int32_t type = strtol(param[0x1], nullptr, NUMBER_BASE);
+    int32_t type = 0;//strtol(param[0x1], nullptr, NUMBER_BASE);
     if (g_voiceCallVolteContext != nullptr) {
         MEDIA_ERR_LOG("invalid operation");
         goto EXIT;
@@ -427,7 +427,7 @@ static int32_t StartVoiceCall(const char **param)
     
     // For Bluetooth voice call, we only support type 0 (normal voice call)
     if (type == 0) {
-        MediaThreadattr attr = { "VoiceCallVolteThread", 0x2000, THREAD_SCHED_INVALID, 0, true };
+        MediaThreadattr attr = { "VoiceCallVolteThreadbluetooth", 0x2000, THREAD_SCHED_INVALID, 0, false };
         MediaThreadIdHandle taskHandle = MediaThreadCreate(VoiceCallVolteThread, g_voiceCallVolteContext, &attr);
         if (taskHandle == nullptr) {
             MEDIA_ERR_LOG("create voice call volte thread failed");
@@ -436,7 +436,7 @@ static int32_t StartVoiceCall(const char **param)
             return -1;
         }
         g_voiceCallVolteContext->taskHandle = taskHandle;
-    } else {
+            } else {
         MEDIA_ERR_LOG("unsupported voice call type: %d", type);
         free(g_voiceCallVolteContext);
         g_voiceCallVolteContext = nullptr;
@@ -467,7 +467,7 @@ static int32_t StopVoiceCall(const char **param)
     g_voiceCallVolteContext->isVoiceCallVolteStopped = true;
     MediaThreadCondSignal(g_voiceCallVolteContext->cond);
     MediaMutexUnLock(g_voiceCallVolteContext->mutex);
-    
+
     MediaThreadJoin(&g_voiceCallVolteContext->taskHandle);
     (void)MediaThreadCondDestroy(&g_voiceCallVolteContext->cond);
     (void)MediaMutexDestroy(&g_voiceCallVolteContext->mutex);
@@ -509,14 +509,23 @@ static int32_t VoiceCallMicMute(const char **param)
         MEDIA_ERR_LOG("not support set mic mute!");
         return -1;
     }
-    
+    printf("VoiceCallMicMute : %s\r\n",param[0x1]);
+    int32_t mute=0;
     int32_t mute = strtol(param[0x1], nullptr, NUMBER_BASE);
-    int32_t ret = 0;
-    if (mute == 0) {
-        ret = AudioStreamOutSetMute(false);
-    } else {
-        ret = AudioStreamOutSetMute(true);
+    int32_t ret = -1;
+    printf("AudioStreamOutSetMute : %d\r\n",mute);
+
+    if(g_streamOutUplink)
+    {
+       ret = g_streamOutUplink->SetMute(mute);
     }
+
+    if(g_streamOutDownink)
+    {
+       ret = g_streamOutDownink->SetMute(mute);
+    }
+
+
     
     if (ret != 0) {
         MEDIA_ERR_LOG("set mic mute failed");
@@ -553,9 +562,9 @@ static int32_t VoiceCallSetVolume(const char **param)
 int32_t VoiceCallVolteBluetoothSample(int32_t argc, const char *argv[])
 {
     MEDIA_UNUSED(argc);
-    MEDIA_INFO_LOG("enter bluetooth voice call volte sample");
+    printf("enter bluetooth voice call volte sample\r\n");
 
-    MEDIA_INFO_LOG("input param:%s", argv[0]);
+    printf("input param:%s\r\n", argv[0]);
 
     int32_t ret = -1;
     for (uint32_t i = 0; i < ARRAY_SIZE(g_voiceCallVolteFuncs); i++) {
@@ -564,11 +573,11 @@ int32_t VoiceCallVolteBluetoothSample(int32_t argc, const char *argv[])
         } else {
             continue;
         }
-        MEDIA_INFO_LOG("%s execute %s", g_voiceCallVolteFuncs[i].cmd, (ret != 0) ? "failed" : "success");
+        printf("%s execute %s \r\n", g_voiceCallVolteFuncs[i].cmd, (ret != 0) ? "failed" : "success");
     }
 
     // will free g_voiceCallVolteContext when voice call volte exit
-    MEDIA_INFO_LOG("exit");
+    printf("exit\r\n");
     return 0;
 }
 
index 60e7419..b141d7d 100644 (file)
@@ -320,7 +320,7 @@ void power_off_cat1(void)
 extern void restart_sleep_cat1_timer(void);
 void cat1_ring_isr_callback(pin_t pin, uintptr_t param)
 {
-    // cat1_print_warning("cat1_ring_isr_callback %d 0x%X\n",pin,param);
+    printf("cat1_ring_isr_callback %d 0x%X\n",pin,param);
     uapi_gpio_clear_interrupt(pin);
     // do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_TYPE_ADD_CAT1VOTE,NULL,0);
     cat1_api_add_cat1_vote();
index 82d6bfa..9f2ba67 100644 (file)
@@ -918,9 +918,9 @@ void cat1_call_dial(char* phonenum)
         // #if PY_SRV_VER_CURRENT >=16
         if(g_py_ver>=16)
         {
-            if(osTimerIsRunning(g_timer_time_Dial)==0  )
+            if(osTimerIsRunning(g_timer_time_Dial)==0 )
             {
-                osStatus_t ret = osTimerStart(g_timer_time_Dial,5000); 
+                osStatus_t ret = osTimerStart(g_timer_time_Dial,8000); 
                 cat1_print_info("cat1 g_timer_time_Dial timer ret %d\n",ret);
             }
         }
@@ -1150,11 +1150,11 @@ static void time_sync_func(void)
                 g_msg_callback_func(MESSAGE_4G_NETWORK_STAT_CHANGED,NULL,0);
             }
         }
-        if(osTimerIsRunning(g_timer_time_sync)==1 )
-        {
-            osStatus_t ret = osTimerStop(g_timer_time_sync);
-            cat1_print_info("cat1 powered off, stop timer  , ret %d\n",ret);
-        }
+        // if(osTimerIsRunning(g_timer_time_sync)==1 )
+        // {
+        //     osStatus_t ret = osTimerStop(g_timer_time_sync);
+        //     cat1_print_info("cat1 powered off, stop timer  , ret %d\n",ret);
+        // }
         return ;
     }else{
         if (cat1_api_runtime_get_cat1_powerstat()==0)
@@ -1229,7 +1229,6 @@ int cat1_handle_call_connected(char* phonenum)
     if (g_msg_callback_func!=NULL)
         g_msg_callback_func(MESSAGE_4G_CALL_CONNECTED,phonenum,strlen(phonenum));
         
-    cat1_api_start_cat1_volte_voice();
     return 1;
 }
 //来电挂断处理
@@ -1241,7 +1240,6 @@ int cat1_handle_call_disconnected(char* phonenum)
     if (g_msg_callback_func!=NULL)
         g_msg_callback_func(MESSAGE_4G_CALL_DISCONNECTED,phonenum,strlen(phonenum));
            
-    cat1_api_stop_cat1_volte_voice();
     return 1;
 }
 
index 6312d02..6056377 100644 (file)
@@ -61,6 +61,8 @@ int32_t cat1_cat1_start_SCO_volte_voice(void);
 
 void cat1_UI_call_dial(char *tell);
 
+int32_t cat1_api_set_MicMute_volte_voice(bool data);
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
index fe97fef..ade2f7f 100644 (file)
@@ -145,12 +145,19 @@ int32_t cat1_api_stop_cat1_volte_voice(void)
 
     if(cat1_voice!=0)
     {
-        ret = VoiceCallVolteSample(argc, (const char **)&argv);
+        if(cat1_voice==2)
+        {
+            ret = VoiceCallVolteBluetoothSample(argc, (const char **)&argv);
+        }
+        else
+        {
+            ret = VoiceCallVolteSample(argc, (const char **)&argv);
+        }
         if(ret==0) 
         cat1_voice=0;
     }
 
-    cat1_print_dbg("ret %d %d ",ret, cat1_voice);
+    cat1_print_dbg("cat1_api_stop_cat1_volte_voice ret %d %d ",ret, cat1_voice);
 
     return ret;   
 }
@@ -161,20 +168,61 @@ int32_t cat1_cat1_start_SCO_volte_voice(void)
     int32_t argc = 1;
     uint8_t *argv = (uint8_t *)"start";
 
-    if(cat1_voice!=0)
+    cat1_print_dbg("cat1_cat1_start_SCO_volte_voice %d \n",cat1_voice);
+
+    if(cat1_voice==0)
     {
         ret = VoiceCallVolteBluetoothSample(argc, (const char **)&argv);
         if(ret==0) 
         cat1_voice=2;
     }
+    else
+    {
+        cat1_print_dbg("cat1_voice!=0");
+    }
 
-    cat1_print_dbg("ret %d %d ",ret, cat1_voice);
+    cat1_print_dbg("cat1_cat1_start_SCO_volte_voice ret %d %d ",ret, cat1_voice);
 
     return ret;   
 
 }
 
 
+
+int32_t cat1_api_set_MicMute_volte_voice(bool data)
+{
+    cat1_print_dbg("cat1_api_set_MicMute_volte_voice\n");
+
+    int32_t ret = ERRCODE_FAIL;
+    int32_t argc = 2;
+    const char * argv[] ={"mute", "1"};
+    if(data)
+    {
+        argv[1]="1";
+    }
+    else
+    {
+        argv[1]="0";
+    }
+
+    if(cat1_voice!=0)
+    {
+        if(cat1_voice==2)
+        {
+            ret = VoiceCallVolteBluetoothSample(argc, argv);
+        }
+        else
+        {
+            ret = VoiceCallVolteSample(argc, argv);
+        }
+    }
+
+    cat1_print_dbg("cat1_api_set_MicMute_volte_voice ret %d %d ",ret, cat1_voice);
+
+    return ret;   
+}
+
+
 #include "power_display_service.h"
 /*获取屏幕状态: return 1 need update */
 
@@ -183,7 +231,7 @@ uint8_t cat1_api_need_update_signal(void)
 
     const power_display_svr_api_t *display_api = power_display_svr_get_api();
     screen_state_t state = display_api->get_screen_state();
-    // printf("uapi_get_screen_state = %s . \r\n", state==SCREEN_ON?"on":"off");
+    printf("uapi_get_screen_state = %s . \r\n", state==SCREEN_ON?"on":"off");
     if( state == SCREEN_ON){
         return 1;
     }else{
index c5c1f89..130de26 100644 (file)
@@ -241,6 +241,8 @@ uint32_t uapi_calendar_store_date(void);
 
 #define CUSTOM_CMD_MSG_STOP_CHECK_MIC 0x1E
 
+#define CUSTOM_CMD_MSG_CONNECT_AG 0x1F
+
 typedef enum {
     BR_HFP_CONNECT=1,
     BR_HFP_DISCONNECT,