Add HFP HF APIs on bluetooth_internal 27/188727/1
authorWootak Jung <wootak.jung@samsung.com>
Thu, 6 Sep 2018 01:41:13 +0000 (10:41 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Mon, 10 Sep 2018 01:47:31 +0000 (10:47 +0900)
int bt_hf_request_call_status_info_list(void)
int bt_hf_is_inband_ringtone_supported(bool *supported)

Change-Id: I7c0d5b38d9fd025a779b7f906d632bbb75543558

include/bluetooth_internal.h
src/bluetooth-audio.c
test/bt_unit_test.c
test/bt_unit_test.h

index 3723a07..b8a6b6c 100644 (file)
@@ -2086,6 +2086,51 @@ int bt_hf_get_call_status_info_list(GSList **call_list);
 int bt_hf_free_call_status_info_list(GSList *call_list);
 
 /**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_HF_MODULE
+ * @brief Requests the call status information list.
+ * @since_tizen 3.0
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #BT_ERROR_NONE  Successful
+ * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
+ * @retval #BT_ERROR_NOT_ENABLED  Not enabled
+ * @retval #BT_ERROR_OPERATION_FAILED Operation failed
+ * @retval #BT_ERROR_NO_DATA No data available
+ * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
+ *
+ * @pre The Bluetooth audio device must be connected with bt_audio_connect().
+ * @pre The bt_hf_set_call_status_updated_event_cb() should be set to receive
+ * the event of call status update.
+ * @post This function invokes bt_hf_call_status_updated_event_cb().
+ *
+ * @see bt_audio_connect()
+ * @see bt_hf_set_call_status_updated_event_cb()
+ * @see bt_hf_unset_call_status_updated_event_cb()
+ * @see bt_hf_call_status_updated_event_cb()
+ */
+int bt_hf_request_call_status_info_list(void);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_HF_MODULE
+ * @brief Checks whether the remote AG device supports inband ringtone or not.
+ * @since_tizen @if MOBILE @elseif WEARABLE 2.3.1 @endif
+ *
+ * @param[out] supported Inband support: (@c true = supported, @c  false = not supported)
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #BT_ERROR_NONE  Successful
+ * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
+ * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval #BT_ERROR_NOT_ENABLED  Not enabled
+ * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED  Remote device is not connected
+ * @retval #BT_ERROR_OPERATION_FAILED Operation failed
+ * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
+ *
+ * @pre The Bluetooth audio device must be connected with bt_audio_connect().
+ * @see bt_audio_connect()
+ */
+int bt_hf_is_inband_ringtone_supported(bool *supported);
+
+/**
  * @ingroup  CAPI_NETWORK_BLUETOOTH_AUDIO_A2DP_MODULE
  * @brief  Sets copy protection. streaming application that needs to have the copy protection for the streaming data, shall invoke this API.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
index bf160b0..a76c7ec 100644 (file)
@@ -1209,6 +1209,22 @@ int bt_hf_get_call_status_info_list(GSList **call_list)
        return error;
 }
 
+int bt_hf_request_call_status_info_list(void)
+{
+       BT_CHECK_HF_SUPPORT();
+       BT_CHECK_INIT_STATUS();
+       BT_CHECK_HF_INIT_STATUS();
+
+       int error;
+
+       error = bluetooth_hf_request_call_list_async();
+       error = _bt_get_error_code(error);
+       if (error != BT_ERROR_NONE)
+               BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error), error);
+
+       return error;
+}
+
 int bt_hf_is_inband_ringtone_supported(bool *supported)
 {
        BT_CHECK_HF_SUPPORT();
index 2635609..0127415 100644 (file)
@@ -1014,6 +1014,8 @@ tc_table_t tc_hf[] = {
                , BT_UNIT_TEST_FUNCTION_HF_NOTIFY_CALL_TERM},
        {"(CALL Status) bt_hf_get_call_status_info_list"
                , BT_UNIT_TEST_FUNCTION_HF_GET_CALL_STATUS_INFO_LIST},
+       {"(CALL Status) bt_hf_request_call_status_info_list"
+               , BT_UNIT_TEST_FUNCTION_HF_REQUEST_CALL_STATUS_INFO_LIST},
        {"(CALL Status) bt_hf_set_call_handling_event_cb()"
                , BT_UNIT_TEST_FUNCTION_HF_SET_CALL_EVENT_CB},
        {"(CALL Status) bt_hf_unset_call_handling_event_cb"
@@ -9098,6 +9100,11 @@ int test_input_callback(void *data)
                        }
                        break;
                }
+               case BT_UNIT_TEST_FUNCTION_HF_REQUEST_CALL_STATUS_INFO_LIST: {
+                       ret = bt_hf_request_call_status_info_list();
+                       TC_PRT("returns %s\n", __bt_get_error_message(ret));
+                       break;
+               }
                case BT_UNIT_TEST_FUNCTION_HF_SET_SCO_CHANGED_CB:
                        ret = bt_hf_set_sco_state_changed_cb(
                                        __bt_hf_sco_state_changed_cb, NULL);
index c7e37a5..6ae90c2 100644 (file)
@@ -417,6 +417,7 @@ typedef enum {
        BT_UNIT_TEST_FUNCTION_HF_NOTIFY_CALL_TERM,
        BT_UNIT_TEST_FUNCTION_HF_NOTIFY_CALL_WITH_PARAM,
        BT_UNIT_TEST_FUNCTION_HF_GET_CALL_STATUS_INFO_LIST,
+       BT_UNIT_TEST_FUNCTION_HF_REQUEST_CALL_STATUS_INFO_LIST,
        BT_UNIT_TEST_FUNCTION_HF_SET_CALL_EVENT_CB,
        BT_UNIT_TEST_FUNCTION_HF_UNSET_CALL_EVENT_CB,
        BT_UNIT_TEST_FUNCTION_HF_SET_CALL_STATUS_UPDATED_EVENT_CB,