From: Avichal Date: Fri, 25 Jan 2019 12:14:18 +0000 (+0530) Subject: Adding support in avrcp to control multiple a2dp source X-Git-Tag: accepted/tizen/unified/20190212.084052~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=952a3738845bfa6f872326de2657dc45e0717782;p=platform%2Fcore%2Fapi%2Fbluetooth.git Adding support in avrcp to control multiple a2dp source Modifying functionalility of ARCP controller Change-Id: Icdac34e77ae6c93aafc7cf6844d4acb787e43a1a --- diff --git a/include/bluetooth_internal.h b/include/bluetooth_internal.h index e9a3286..0dda44a 100644 --- a/include/bluetooth_internal.h +++ b/include/bluetooth_internal.h @@ -2168,6 +2168,31 @@ int bt_hf_is_inband_ringtone_supported(bool *supported); */ int bt_a2dp_set_content_protection(bool status); + +/** + * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_CONTROL_MODULE + * @brief Sends a command to the target device. + * @since_tizen 5.5 + * @privlevel platform + * @privilege %http://tizen.org/privilege/bluetooth.admin + * @param[in] cmd The commands, one of: Play, Pause, Next, Rewind. + * @param[in] remote_address The address of the remote Bluetooth device + * @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 Bluetooth audio service must be initialized with bt_avrcp_control_initialize(). + * @see bt_avrcp_control_initialize() + * @see bt_avrcp_control_connect() + */ +int bt_avrcp_control_send_player_command_to(bt_avrcp_player_command_e cmd, char *remote_address); + + /** * @internal * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE diff --git a/src/bluetooth-avrcp.c b/src/bluetooth-avrcp.c index 8b6a1ed..607dad6 100644 --- a/src/bluetooth-avrcp.c +++ b/src/bluetooth-avrcp.c @@ -390,6 +390,28 @@ int bt_avrcp_control_send_player_command(bt_avrcp_player_command_e cmd) return error; } +/* LCOV_EXCL_START */ +int bt_avrcp_control_send_player_command_to(bt_avrcp_player_command_e cmd, char *remote_address) +{ + int error; + bluetooth_device_address_t addr_hex = { {0,} }; + + BT_CHECK_AVRCP_CONTROL_SUPPORT(); + BT_CHECK_INIT_STATUS(); + BT_CHECK_AVRCP_CONTROL_INIT_STATUS(); + + _bt_convert_address_to_hex(&addr_hex, remote_address); + + error = bluetooth_media_control_command_to_dest(cmd, &addr_hex); + 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); + + return error; +} +/* LCOV_EXCL_STOP */ + int bt_avrcp_control_set_absolute_volume(unsigned int value) { int error;