补交hfp开关 541/1 541/head 542/target/1 543/target/1
authorhcj <1224667075@qq.com>
Wed, 17 Jul 2024 06:45:42 +0000 (14:45 +0800)
committerhcj <1224667075@qq.com>
Wed, 17 Jul 2024 06:45:42 +0000 (14:45 +0800)
code/sdk/application/wearable/fd230app/nativeui/phoneservice/include/PhoneService.h
code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneService.cpp

index 594b9fd..5cb511d 100644 (file)
@@ -256,6 +256,12 @@ uint32 GetCallCodec(void);
 // 添加通话进通话记录文件
 void AddToCallLog(CallLogInfo *info);
 
+int uapi_hfp_disconnect(void);
+
+int uapi_hfp_connect(void);
+
+int uapi_hfp_connect_state(void);
+
 #ifdef __cplusplus
 }
 #endif
index 055adb2..f301059 100644 (file)
@@ -1853,6 +1853,34 @@ int TransCallToMobilePhone(void)
     }
 }
 
+int uapi_hfp_disconnect(void)
+{
+    int ret;
+    ret = hfp_hf_disconnect(&g_bdAddr);
+    WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[hfp_disconnect] ret:%d", ret);
+    return ret;   
+}
+
+int uapi_hfp_connect(void)
+{
+    int ret;
+    ret = hfp_hf_connect(&g_bdAddr);
+    WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[hfp_connect_hfp] ret:%d", ret);
+    return ret;   
+}
+
+int uapi_hfp_connect_state(void)
+{
+    int ret;
+    ret = hfp_hf_get_device_connect_state(&g_bdAddr);
+    WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[hfp_connect_hfp] ret:%d", ret);
+    if(PROFILE_STATE_CONNECTED==ret || PROFILE_STATE_CONNECTING ==ret)
+    return 1;
+    else
+    return 0;
+}
+
+
 #ifdef __cplusplus
 }
 #endif