Adding support in avrcp to control multiple a2dp source 66/198566/3
authorAvichal <avichal.a@samsung.com>
Fri, 25 Jan 2019 12:14:18 +0000 (17:44 +0530)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Fri, 1 Feb 2019 00:14:00 +0000 (09:14 +0900)
Modifying functionalility of ARCP controller

Change-Id: Icdac34e77ae6c93aafc7cf6844d4acb787e43a1a

include/bluetooth_internal.h
src/bluetooth-avrcp.c

index e9a3286..0dda44a 100644 (file)
@@ -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
index 8b6a1ed..607dad6 100644 (file)
@@ -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;