Add the internal API of delay report 07/174107/4
authorHyuk Lee <hyuk0512.lee@samsung.com>
Wed, 28 Mar 2018 06:57:15 +0000 (15:57 +0900)
committerHyuk Lee <hyuk0512.lee@samsung.com>
Mon, 9 Apr 2018 01:05:42 +0000 (10:05 +0900)
Change-Id: Ic5e152ef594023b54e9c919f90048d86e160b474
Signed-off-by: Hyuk Lee <hyuk0512.lee@samsung.com>
include/bluetooth_internal.h
src/bluetooth-avrcp.c
test/bt_unit_test.c
test/bt_unit_test.h

index 3e31937856e9646e1f97dd7f1b6e22339570bc6d..359195f04ad43fddc1ee36aa8ef3d5cf939b5541 100644 (file)
@@ -3496,6 +3496,29 @@ int bt_hid_device_send_custom_event(const char *remote_address,
  */
 int bt_avrcp_control_set_absolute_volume(unsigned int value);
 
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_CONTROL_MODULE
+ * @brief  Sends the delay report to the remote device.
+ * @since_tizen 5.0
+ * @privlevel platform
+ * @privilege %http://tizen.org/privilege/bluetooth.admin
+ * @param[in] value The new delay level
+ * @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_OPERATION_FAILED  Operation failed
+ * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED  Remote device is not connected
+ * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
+ * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
+ *
+ * @pre The remote device must be connected.
+ * @see bt_avrcp_target_connection_state_changed_cb()
+ * @see bt_avrcp_target_initialize()
+ */
+int bt_avrcp_control_send_delay_report(unsigned int value);
+
 /**
  * @ingroup CAPI_NETWORK_BLUETOOTH_PROXIMITY_MODULE
  * @brief Creates the Proximity Profile Reporter Role.
index 3a35c51130f2704a6f9c819aa809289d83a3462f..150ab5ab0a09c91ff4952efdce4b7c2a8bb7842a 100644 (file)
@@ -406,6 +406,22 @@ int bt_avrcp_control_set_absolute_volume(unsigned int value)
        return error;
 }
 
+int bt_avrcp_control_send_delay_report(unsigned int value)
+{
+       int error;
+
+       BT_CHECK_AVRCP_CONTROL_SUPPORT();
+       BT_CHECK_INIT_STATUS();
+       BT_CHECK_AVRCP_CONTROL_INIT_STATUS();
+       error = bluetooth_media_transport_set_property(DELAY, value);
+       error = _bt_convert_avrcp_error_code(error);
+       error = _bt_get_error_code(error);
+       if (BT_ERROR_NONE != error)
+               BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error), error); /* LCOV_EXCL_LINE */
+
+       return error;
+}
+
 int bt_avrcp_control_set_equalizer_state(bt_avrcp_equalizer_state_e state)
 {
        int error;
index 59f3cb1a5319f2f5888738d3873a64c92af37974..eb5c98b613596c46de5fec9d6e656f92c62e010f 100644 (file)
@@ -8468,6 +8468,12 @@ int test_input_callback(void *data)
                        TC_PRT("returns %s\n", __bt_get_error_message(ret));
                        break;
                        }
+               case BT_UNIT_TEST_FUNCTION_AVRCP_CONTROL_SEND_DELAY_REPORT: {
+                       static unsigned int delay_level = 1;
+                       ret = bt_avrcp_control_send_delay_report(delay_level++);
+                       TC_PRT("returns %s\n", __bt_get_error_message(ret));
+                       break;
+                       }
                case BT_UNIT_TEST_FUNCTION_AVRCP_CONTROL_GET_REPEAT: {
                        bt_avrcp_repeat_mode_e mode = BT_AVRCP_REPEAT_MODE_GROUP;
                        ret = bt_avrcp_control_get_repeat_mode(&mode);
index 4c4622c598623335171e1e8413465acba79f0cd4..08c1302ee88e9fa229ce1c49fb8514c443747c41 100644 (file)
@@ -315,6 +315,7 @@ BT_UNIT_TEST_FUNCTION_ADAPTER_LE_REGISTER_SCAN_FILTER_MANUFACTURER_DATA,
        BT_UNIT_TEST_FUNCTION_AVRCP_CONTROL_NEXT,
        BT_UNIT_TEST_FUNCTION_AVRCP_CONTROL_PREV,
        BT_UNIT_TEST_FUNCTION_AVRCP_CONTROL_SET_ABSOLUTE_VOLUME,
+       BT_UNIT_TEST_FUNCTION_AVRCP_CONTROL_SEND_DELAY_REPORT,
        BT_UNIT_TEST_FUNCTION_AVRCP_CONTROL_GET_REPEAT,
        BT_UNIT_TEST_FUNCTION_AVRCP_CONTROL_SET_REPEAT,
        BT_UNIT_TEST_FUNCTION_AVRCP_CONTROL_GET_SHUFFLE,