Tizen(Headless) Native API  6.0
Bluetooth AVRCP Controller

Bluetooth AVRCP(Audio/Video Remote Control Profile) Control API provides functions for controlling the remote device.

Required Header

#include <bluetooth.h>

Overview

This API supports the Controller role in the AVRCP spec. In a "walkman" type media player scenario, the Control device may be a headset that allows tracks to be skipped and the Target device would be the actual medial player.

Related Features

This API is related with the following features:

  • http://tizen.org/feature/network.bluetooth.audio.controller

It is recommended to create application with regard to features, to increase reliability.

You can check if a device supports the related features for this API by using System Information, thereby controlling the procedure of your application.

To ensure your application is only running on a device with specific features, please define the features in your manifest file using the manifest editor in the SDK.

More details on featuring your application can be found from Feature Element.

Functions

int bt_avrcp_control_initialize (bt_avrcp_control_connection_state_changed_cb callback, void *user_data)
 Initializes the Bluetooth AVRCP (Audio/Video Remote Control Profile) controller service.
int bt_avrcp_control_deinitialize (void)
 Deinitializes the Bluetooth AVRCP (Audio/Video Remote Control Profile) controller service.
int bt_avrcp_control_connect (const char *remote_address)
 Connects the AVRCP (Audio/Video Remote Control Profile) target device.
int bt_avrcp_control_disconnect (const char *remote_address)
 Disconnects from the AVRCP (Audio/Video Remote Control Profile) target device.
int bt_avrcp_control_send_player_command (bt_avrcp_player_command_e cmd)
 Sends a command to the target device.
int bt_avrcp_control_set_equalizer_state (bt_avrcp_equalizer_state_e state)
 Sends the equalizer state change request to the remote device.
int bt_avrcp_control_get_equalizer_state (bt_avrcp_equalizer_state_e *state)
 Gets the the equalizer state of the remote device.
int bt_avrcp_control_set_repeat_mode (bt_avrcp_repeat_mode_e mode)
 Sends the repeat change request to the remote device.
int bt_avrcp_control_get_repeat_mode (bt_avrcp_repeat_mode_e *mode)
 Gets the repeat state of the remote device.
int bt_avrcp_control_set_shuffle_mode (bt_avrcp_shuffle_mode_e mode)
 Sends the shuffle mode change request to the remote device.
int bt_avrcp_control_get_shuffle_mode (bt_avrcp_shuffle_mode_e *mode)
 Gets the shuffle mode of the remote device.
int bt_avrcp_control_set_scan_mode (bt_avrcp_scan_mode_e mode)
 Sends the scan mode change request to the remote device.
int bt_avrcp_control_get_scan_mode (bt_avrcp_scan_mode_e *mode)
 Gets the scan mode of the remote device.
int bt_avrcp_control_get_position (unsigned int *position)
 Gets the position of the song played by the remote device.
int bt_avrcp_control_get_play_status (bt_avrcp_player_state_e *status)
 Gets the play status of the remote device.
int bt_avrcp_control_get_track_info (bt_avrcp_metadata_attributes_info_s **track)
 Gets the metadata of the track played by the remote device.
int bt_avrcp_control_free_track_info (bt_avrcp_metadata_attributes_info_s *track)
 Frees the track metadata.

Function Documentation

int bt_avrcp_control_connect ( const char *  remote_address)

Connects the AVRCP (Audio/Video Remote Control Profile) target device.

Since :
3.0
Privilege Level:
public
Privilege:
http://tizen.org/privilege/bluetooth
Parameters:
[in]remote_addressThe remote address
Returns:
0 on success, otherwise a negative error value.
Return values:
BT_ERROR_NONESuccessful
BT_ERROR_NOT_INITIALIZEDNot initialized
BT_ERROR_INVALID_PARAMETERInvalid parameter
BT_ERROR_NOT_SUPPORTEDNot supported
BT_ERROR_PERMISSION_DENIEDPermission denied
Precondition:
The Bluetooth audio service must be initialized with bt_avrcp_control_initialize().
See also:
bt_avrcp_control_initialize()

Deinitializes the Bluetooth AVRCP (Audio/Video Remote Control Profile) controller service.

Since :
3.0
Returns:
0 on success, otherwise a negative error value.
Return values:
BT_ERROR_NONESuccessful
BT_ERROR_NOT_INITIALIZEDNot initialized
BT_ERROR_NOT_SUPPORTEDNot supported
Precondition:
The Bluetooth audio service must be initialized with bt_avrcp_control_initialize().
See also:
bt_avrcp_control_initialize()
int bt_avrcp_control_disconnect ( const char *  remote_address)

Disconnects from the AVRCP (Audio/Video Remote Control Profile) target device.

Since :
3.0
Privilege Level:
public
Privilege:
http://tizen.org/privilege/bluetooth
Parameters:
[in]remote_addressThe remote address
Returns:
0 on success, otherwise a negative error value.
Return values:
BT_ERROR_NONESuccessful
BT_ERROR_NOT_INITIALIZEDNot initialized
BT_ERROR_INVALID_PARAMETERInvalid parameter
BT_ERROR_NOT_SUPPORTEDNot supported
BT_ERROR_PERMISSION_DENIEDPermission denied
Precondition:
The Bluetooth audio service must be initialized with bt_avrcp_control_initialize().
See also:
bt_avrcp_control_initialize()
bt_avrcp_control_connect()

Frees the track metadata.

Since :
3.0
Parameters:
[in]trackThe track metadata.
Returns:
0 on success, otherwise a negative error value.
Return values:
BT_ERROR_NONESuccessful
BT_ERROR_NOT_INITIALIZEDNot initialized
BT_ERROR_INVALID_PARAMETERInvalid parameter
BT_ERROR_NOT_SUPPORTEDNot supported
Precondition:
track should point to valid metadata address.
See also:
bt_avrcp_control_get_track_info()
bt_avrcp_target_initialize()

Gets the the equalizer state of the remote device.

Since :
3.0
Parameters:
[out]stateThe equalizer state, one of: ON, OFF
Returns:
0 on success, otherwise a negative error value.
Return values:
BT_ERROR_NONESuccessful
BT_ERROR_NOT_INITIALIZEDNot initialized
BT_ERROR_INVALID_PARAMETERInvalid parameter
BT_ERROR_NOT_ENABLEDNot enabled
BT_ERROR_OPERATION_FAILEDOperation failed
BT_ERROR_REMOTE_DEVICE_NOT_CONNECTEDRemote device is not connected
BT_ERROR_NOT_SUPPORTEDNot supported
Precondition:
The remote device must be connected.
See also:
bt_avrcp_target_connection_state_changed_cb()
bt_avrcp_target_initialize()

Gets the play status of the remote device.

Since :
3.0
Parameters:
[out]statusThe play status, one of: PLAYING, STOPPED...
Returns:
0 on success, otherwise a negative error value.
Return values:
BT_ERROR_NONESuccessful
BT_ERROR_NOT_INITIALIZEDNot initialized
BT_ERROR_INVALID_PARAMETERInvalid parameter
BT_ERROR_NOT_ENABLEDNot enabled
BT_ERROR_OPERATION_FAILEDOperation failed
BT_ERROR_REMOTE_DEVICE_NOT_CONNECTEDRemote device is not connected
BT_ERROR_NOT_SUPPORTEDNot supported
Precondition:
The remote device must be connected.
See also:
bt_avrcp_target_connection_state_changed_cb()
bt_avrcp_target_initialize()
int bt_avrcp_control_get_position ( unsigned int *  position)

Gets the position of the song played by the remote device.

Since :
3.0
Parameters:
[out]positionThe position, in milliseconds
Returns:
0 on success, otherwise a negative error value.
Return values:
BT_ERROR_NONESuccessful
BT_ERROR_NOT_INITIALIZEDNot initialized
BT_ERROR_INVALID_PARAMETERInvalid parameter
BT_ERROR_NOT_ENABLEDNot enabled
BT_ERROR_OPERATION_FAILEDOperation failed
BT_ERROR_REMOTE_DEVICE_NOT_CONNECTEDRemote device is not connected
BT_ERROR_NOT_SUPPORTEDNot supported
Precondition:
The remote device must be connected.
See also:
bt_avrcp_target_connection_state_changed_cb()
bt_avrcp_target_initialize()

Gets the repeat state of the remote device.

Since :
3.0
Parameters:
[out]modeThe repeat mode, one of: OFF, SINGLE, ALL
Returns:
0 on success, otherwise a negative error value.
Return values:
BT_ERROR_NONESuccessful
BT_ERROR_NOT_INITIALIZEDNot initialized
BT_ERROR_INVALID_PARAMETERInvalid parameter
BT_ERROR_NOT_ENABLEDNot enabled
BT_ERROR_OPERATION_FAILEDOperation failed
BT_ERROR_REMOTE_DEVICE_NOT_CONNECTEDRemote device is not connected
BT_ERROR_NOT_SUPPORTEDNot supported
Precondition:
The remote device must be connected.
See also:
bt_avrcp_target_connection_state_changed_cb()
bt_avrcp_target_initialize()

Gets the scan mode of the remote device.

Since :
3.0
Parameters:
[out]modeThe scan mode, one of: OFF, GROUP, ALL
Returns:
0 on success, otherwise a negative error value.
Return values:
BT_ERROR_NONESuccessful
BT_ERROR_NOT_INITIALIZEDNot initialized
BT_ERROR_INVALID_PARAMETERInvalid parameter
BT_ERROR_NOT_ENABLEDNot enabled
BT_ERROR_OPERATION_FAILEDOperation failed
BT_ERROR_REMOTE_DEVICE_NOT_CONNECTEDRemote device is not connected
BT_ERROR_NOT_SUPPORTEDNot supported
Precondition:
The remote device must be connected.
See also:
bt_avrcp_target_connection_state_changed_cb()
bt_avrcp_target_initialize()

Gets the shuffle mode of the remote device.

Since :
3.0
Parameters:
[out]modeThe shuffle mode, one of: OFF, GROUP, ALL
Returns:
0 on success, otherwise a negative error value.
Return values:
BT_ERROR_NONESuccessful
BT_ERROR_NOT_INITIALIZEDNot initialized
BT_ERROR_INVALID_PARAMETERInvalid parameter
BT_ERROR_NOT_ENABLEDNot enabled
BT_ERROR_OPERATION_FAILEDOperation failed
BT_ERROR_REMOTE_DEVICE_NOT_CONNECTEDRemote device is not connected
BT_ERROR_NOT_SUPPORTEDNot supported
Precondition:
The remote device must be connected.
See also:
bt_avrcp_target_connection_state_changed_cb()
bt_avrcp_target_initialize()

Gets the metadata of the track played by the remote device.

Since :
3.0
Remarks:
The track must be released using bt_avrcp_control_free_track_info().
Parameters:
[out]trackThe track metadata.
Returns:
0 on success, otherwise a negative error value.
Return values:
BT_ERROR_NONESuccessful
BT_ERROR_NOT_INITIALIZEDNot initialized
BT_ERROR_INVALID_PARAMETERInvalid parameter
BT_ERROR_NOT_ENABLEDNot enabled
BT_ERROR_OPERATION_FAILEDOperation failed
BT_ERROR_REMOTE_DEVICE_NOT_CONNECTEDRemote device is not connected
BT_ERROR_NOT_SUPPORTEDNot supported
Precondition:
The remote device must be connected.
See also:
bt_avrcp_target_connection_state_changed_cb()
bt_avrcp_target_initialize()

Initializes the Bluetooth AVRCP (Audio/Video Remote Control Profile) controller service.

Since :
3.0
Remarks:
This function must be called before any other AVRCP controller functions are called.
You must free all resources of the this service by calling bt_avrcp_control_deinitialize()
if Bluetooth AVRCP service is no longer needed.
Parameters:
[in]callbackThe callback function called when the connection state is changed
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value.
Return values:
BT_ERROR_NONESuccessful
BT_ERROR_NOT_INITIALIZEDNot initialized
BT_ERROR_INVALID_PARAMETERInvalid parameter
BT_ERROR_OPERATION_FAILEDOperation failed
BT_ERROR_NOT_SUPPORTEDNot supported
Precondition:
The Bluetooth service must be initialized with bt_initialize().
See also:
bt_initialize()
bt_avrcp_control_deinitialize()

Sends a command to the target device.

Since :
3.0
Privilege Level:
public
Privilege:
http://tizen.org/privilege/bluetooth
Parameters:
[in]cmdThe commands, one of: Play, Pause, Next, Rewind.
Returns:
0 on success, otherwise a negative error value.
Return values:
BT_ERROR_NONESuccessful
BT_ERROR_NOT_INITIALIZEDNot initialized
BT_ERROR_INVALID_PARAMETERInvalid parameter
BT_ERROR_NOT_ENABLEDNot enabled
BT_ERROR_OPERATION_FAILEDOperation failed
BT_ERROR_REMOTE_DEVICE_NOT_CONNECTEDRemote device is not connected
BT_ERROR_PERMISSION_DENIEDPermission denied
BT_ERROR_NOT_SUPPORTEDNot supported
Precondition:
The Bluetooth audio service must be initialized with bt_avrcp_control_initialize().
See also:
bt_avrcp_control_initialize()
bt_avrcp_control_connect()

Sends the equalizer state change request to the remote device.

Since :
3.0
Privilege Level:
public
Privilege:
http://tizen.org/privilege/bluetooth
Parameters:
[in]stateThe new equalizer state, one of: ON, OFF
Returns:
0 on success, otherwise a negative error value.
Return values:
BT_ERROR_NONESuccessful
BT_ERROR_NOT_INITIALIZEDNot initialized
BT_ERROR_INVALID_PARAMETERInvalid parameter
BT_ERROR_NOT_ENABLEDNot enabled
BT_ERROR_OPERATION_FAILEDOperation failed
BT_ERROR_REMOTE_DEVICE_NOT_CONNECTEDRemote device is not connected
BT_ERROR_PERMISSION_DENIEDPermission denied
BT_ERROR_NOT_SUPPORTEDNot supported
Precondition:
The remote device must be connected.
See also:
bt_avrcp_target_connection_state_changed_cb()
bt_avrcp_target_initialize()

Sends the repeat change request to the remote device.

Since :
3.0
Privilege Level:
public
Privilege:
http://tizen.org/privilege/bluetooth
Parameters:
[in]modeThe new repeat mode, one of: OFF, SINGLE, ALL
Returns:
0 on success, otherwise a negative error value.
Return values:
BT_ERROR_NONESuccessful
BT_ERROR_NOT_INITIALIZEDNot initialized
BT_ERROR_INVALID_PARAMETERInvalid parameter
BT_ERROR_NOT_ENABLEDNot enabled
BT_ERROR_OPERATION_FAILEDOperation failed
BT_ERROR_REMOTE_DEVICE_NOT_CONNECTEDRemote device is not connected
BT_ERROR_PERMISSION_DENIEDPermission denied
BT_ERROR_NOT_SUPPORTEDNot supported
Precondition:
The remote device must be connected.
See also:
bt_avrcp_target_connection_state_changed_cb()
bt_avrcp_target_initialize()

Sends the scan mode change request to the remote device.

Since :
3.0
Privilege Level:
public
Privilege:
http://tizen.org/privilege/bluetooth
Parameters:
[in]modeThe new scan mode, one of: OFF, GROUP, ALL
Returns:
0 on success, otherwise a negative error value.
Return values:
BT_ERROR_NONESuccessful
BT_ERROR_NOT_INITIALIZEDNot initialized
BT_ERROR_INVALID_PARAMETERInvalid parameter
BT_ERROR_NOT_ENABLEDNot enabled
BT_ERROR_OPERATION_FAILEDOperation failed
BT_ERROR_REMOTE_DEVICE_NOT_CONNECTEDRemote device is not connected
BT_ERROR_PERMISSION_DENIEDPermission denied
BT_ERROR_NOT_SUPPORTEDNot supported
Precondition:
The remote device must be connected.
See also:
bt_avrcp_target_connection_state_changed_cb()
bt_avrcp_target_initialize()

Sends the shuffle mode change request to the remote device.

Since :
3.0
Privilege Level:
public
Privilege:
http://tizen.org/privilege/bluetooth
Parameters:
[in]modeThe new shuffle mode, one of: OFF, GROUP, ALL
Returns:
0 on success, otherwise a negative error value.
Return values:
BT_ERROR_NONESuccessful
BT_ERROR_NOT_INITIALIZEDNot initialized
BT_ERROR_INVALID_PARAMETERInvalid parameter
BT_ERROR_NOT_ENABLEDNot enabled
BT_ERROR_OPERATION_FAILEDOperation failed
BT_ERROR_REMOTE_DEVICE_NOT_CONNECTEDRemote device is not connected
BT_ERROR_PERMISSION_DENIEDPermission denied
BT_ERROR_NOT_SUPPORTEDNot supported
Precondition:
The remote device must be connected.
See also:
bt_avrcp_target_connection_state_changed_cb()
bt_avrcp_target_initialize()