From 0c5158fa3e121d1936b0fb568193db96a31dc60e Mon Sep 17 00:00:00 2001 From: Sangki Park Date: Fri, 22 Dec 2017 15:45:27 +0900 Subject: [PATCH] Add HFP HF API : bt_hf_request_call_status_info_list() Change-Id: I02ab078be712d61ae99794422b1e339c51a826eb Signed-off-by: Sangki Park --- bt-api/bt-audio.c | 25 +++++++++++++++++++++++++ include/bluetooth-api.h | 4 ++++ include/bluetooth-audio-api.h | 2 ++ 3 files changed, 31 insertions(+) diff --git a/bt-api/bt-audio.c b/bt-api/bt-audio.c index dd7eef7..2016b70 100644 --- a/bt-api/bt-audio.c +++ b/bt-api/bt-audio.c @@ -1081,6 +1081,31 @@ BT_EXPORT_API int bluetooth_hf_request_call_list( return BLUETOOTH_ERROR_NONE; } +BT_EXPORT_API int bluetooth_hf_request_call_list_async(void) +{ + GVariant *reply = NULL; + GError *err = NULL; + int ret = BLUETOOTH_ERROR_INTERNAL; + + BT_CHECK_ENABLED(return); + + reply = __bt_hf_agent_dbus_send(BT_HF_OBJECT_PATH, BT_HF_INTERFACE, + "RequestCallListAsync", &err, NULL); + if (!reply) { + BT_ERR("Error returned in method call\n"); + if (err) { + BT_ERR("Error = %s", err->message); + if (strstr(err->message, "No data")) + ret = BLUETOOTH_ERROR_NO_DATA; + g_clear_error(&err); + } + return ret; + } + + g_variant_unref(reply); + return BLUETOOTH_ERROR_NONE; +} + BT_EXPORT_API int bluetooth_hf_get_codec(unsigned int *codec_id) { GVariant *reply = NULL; diff --git a/include/bluetooth-api.h b/include/bluetooth-api.h index 0e555dd..8286f5c 100644 --- a/include/bluetooth-api.h +++ b/include/bluetooth-api.h @@ -184,6 +184,10 @@ extern "C" { #define BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION ((int)BLUETOOTH_ERROR_BASE - 0x28) /**< Device Policy Restricted */ + +#define BLUETOOTH_ERROR_NO_DATA ((int)BLUETOOTH_ERROR_BASE - 0x29) + /**< No data */ + /** * Error codes for ATT Error response * */ diff --git a/include/bluetooth-audio-api.h b/include/bluetooth-audio-api.h index 86d6b55..6fadb5c 100644 --- a/include/bluetooth-audio-api.h +++ b/include/bluetooth-audio-api.h @@ -270,6 +270,8 @@ int bluetooth_hf_free_call_list(bt_hf_call_list_s *call_list); int bluetooth_hf_request_call_list(bt_hf_call_list_s **call_list); +int bluetooth_hf_request_call_list_async(void); + int bluetooth_hf_get_codec(unsigned int *codec_id); int bluetooth_hf_get_audio_connected(unsigned int *audio_connected); -- 2.7.4