Tizen Native API
Bluetooth AVRCP

Functions

int bt_avrcp_target_initialize (bt_avrcp_target_connection_state_changed_cb callback, void *user_data)
 Initializes the Bluetooth AVRCP(Audio/Video Remote Control Profile) service.
int bt_avrcp_target_deinitialize (void)
 Deinitializes the Bluetooth AVRCP(Audio/Video Remote Control Profile) service.
int bt_avrcp_target_notify_equalizer_state (bt_avrcp_equalizer_state_e state)
 Notifies the equalize state to the remote device.
int bt_avrcp_target_notify_repeat_mode (bt_avrcp_repeat_mode_e mode)
 Notifies the repeat mode to the remote device.
int bt_avrcp_target_notify_shuffle_mode (bt_avrcp_shuffle_mode_e mode)
 Notifies the shuffle mode to the remote device.
int bt_avrcp_target_notify_scan_mode (bt_avrcp_scan_mode_e mode)
 Notifies the scan mode to the remote device.
int bt_avrcp_target_notify_player_state (bt_avrcp_player_state_e state)
 Notifies the player state to the remote device.
int bt_avrcp_target_notify_position (unsigned int position)
 Notifies the current position of song to the remote device.
int bt_avrcp_target_notify_track (const char *title, const char *artist, const char *album, const char *genre, unsigned int track_num, unsigned int total_tracks, unsigned int duration)
 Notifies the track to the remote device.
int bt_avrcp_set_equalizer_state_changed_cb (bt_avrcp_equalizer_state_changed_cb callback, void *user_data)
 Registers a callback function that will be invoked when the equalizer state is changed by the remote control device.
int bt_avrcp_unset_equalizer_state_changed_cb (void)
 Unregisters a callback function that will be invoked when the equalizer state is changed by the remote control device.
int bt_avrcp_set_repeat_mode_changed_cb (bt_avrcp_repeat_mode_changed_cb callback, void *user_data)
 Registers a callback function that will be invoked when the repeat mode is changed by the remote control device.
int bt_avrcp_unset_repeat_mode_changed_cb (void)
 Unregisters a callback function that will be invoked when the repeat mode is changed by the remote control device.
int bt_avrcp_set_shuffle_mode_changed_cb (bt_avrcp_shuffle_mode_changed_cb callback, void *user_data)
 Registers a callback function that will be invoked when the shuffle mode is changed by the remote control device.
int bt_avrcp_unset_shuffle_mode_changed_cb (void)
 Unregisters a callback function that will be invoked when the shuffle mode is changed by the remote control device.
int bt_avrcp_set_scan_mode_changed_cb (bt_avrcp_scan_mode_changed_cb callback, void *user_data)
 Registers a callback function that will be invoked when the scan mode is changed by the remote control device.
int bt_avrcp_unset_scan_mode_changed_cb (void)
 Unregisters a callback function that will be invoked when the scan mode is changed by the remote control device.

Typedefs

typedef void(* bt_avrcp_target_connection_state_changed_cb )(bool connected, const char *remote_address, void *user_data)
 Called when the connection state is changed.
typedef void(* bt_avrcp_equalizer_state_changed_cb )(bt_avrcp_equalizer_state_e equalizer, void *user_data)
 Called when the equalizer state is changed by the remote control device.
typedef void(* bt_avrcp_repeat_mode_changed_cb )(bt_avrcp_repeat_mode_e repeat, void *user_data)
 Called when the repeat mode is changed by the remote control device.
typedef void(* bt_avrcp_shuffle_mode_changed_cb )(bt_avrcp_shuffle_mode_e shuffle, void *user_data)
 Called when the shuffle mode is changed by the remote control device.
typedef void(* bt_avrcp_scan_mode_changed_cb )(bt_avrcp_scan_mode_e scan, void *user_data)
 Called when the scan mode is changed by the remote control device.

Bluetooth AVRCP(Audio/Video Remote Control Profile) API provides functions for notifying the change of target device to the control device.

Required Header

#include <bluetooth.h>

Overview

This API supports the Target role in AVRCP spec. The Target is the device whose characteristics are being altered. 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:

It is recommended to design feature related codes in your application for 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 the 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.


Typedef Documentation

typedef void(* bt_avrcp_equalizer_state_changed_cb)(bt_avrcp_equalizer_state_e equalizer, void *user_data)

Called when the equalizer state is changed by the remote control device.

Since :
2.3
Parameters:
[in]equalizerThe equalizer state
[in]user_dataThe user data passed from the callback registration function
See also:
bt_avrcp_set_equalizer_state_changed_cb()
bt_avrcp_unset_equalizer_state_changed_cb()
typedef void(* bt_avrcp_repeat_mode_changed_cb)(bt_avrcp_repeat_mode_e repeat, void *user_data)

Called when the repeat mode is changed by the remote control device.

Since :
2.3
Parameters:
[in]repeatThe repeat mode
[in]user_dataThe user data passed from the callback registration function
See also:
bt_avrcp_set_repeat_mode_changed_cb()
bt_avrcp_unset_repeat_mode_changed_cb()
typedef void(* bt_avrcp_scan_mode_changed_cb)(bt_avrcp_scan_mode_e scan, void *user_data)

Called when the scan mode is changed by the remote control device.

Since :
2.3
Parameters:
[in]shuffleThe shuffle mode
[in]user_dataThe user data passed from the callback registration function
See also:
bt_avrcp_set_scan_mode_changed_cb()
bt_avrcp_unset_scan_mode_changed_cb()
typedef void(* bt_avrcp_shuffle_mode_changed_cb)(bt_avrcp_shuffle_mode_e shuffle, void *user_data)

Called when the shuffle mode is changed by the remote control device.

Since :
2.3
Parameters:
[in]shuffleThe shuffle mode
[in]user_dataThe user data passed from the callback registration function
See also:
bt_avrcp_set_shuffle_mode_changed_cb()
bt_avrcp_unset_shuffle_mode_changed_cb()
typedef void(* bt_avrcp_target_connection_state_changed_cb)(bool connected, const char *remote_address, void *user_data)

Called when the connection state is changed.

Since :
2.3
Parameters:
[in]connectedThe state to be changed. true means connected state, Otherwise, false.
[in]remote_addressThe remote address
[in]user_dataThe user data passed from the callback registration function
See also:
bt_avrcp_target_initialize()
bt_avrcp_target_deinitialize()

Enumeration Type Documentation

Enumerations for the equalizer state.

Since :
2.4
Enumerator:
BT_AVRCP_EQUALIZER_STATE_OFF 

Equalizer Off

BT_AVRCP_EQUALIZER_STATE_ON 

Equalizer On

Enumerations for the player state.

Since :
2.4
Enumerator:
BT_AVRCP_PLAYER_STATE_STOPPED 

Stopped

BT_AVRCP_PLAYER_STATE_PLAYING 

Playing

BT_AVRCP_PLAYER_STATE_PAUSED 

Paused

BT_AVRCP_PLAYER_STATE_FORWARD_SEEK 

Seek Forward

BT_AVRCP_PLAYER_STATE_REWIND_SEEK 

Seek Rewind

Enumerations for the repeat mode.

Since :
2.4
Enumerator:
BT_AVRCP_REPEAT_MODE_OFF 

Repeat Off

BT_AVRCP_REPEAT_MODE_SINGLE_TRACK 

Single track repeat

BT_AVRCP_REPEAT_MODE_ALL_TRACK 

All track repeat

BT_AVRCP_REPEAT_MODE_GROUP 

Group repeat

Enumerations for the scan mode.

Since :
2.4
Enumerator:
BT_AVRCP_SCAN_MODE_OFF 

Scan Off

BT_AVRCP_SCAN_MODE_ALL_TRACK 

All tracks scan

BT_AVRCP_SCAN_MODE_GROUP 

Group scan

Enumerations for the shuffle mode.

Since :
2.4
Enumerator:
BT_AVRCP_SHUFFLE_MODE_OFF 

Shuffle Off

BT_AVRCP_SHUFFLE_MODE_ALL_TRACK 

All tracks shuffle

BT_AVRCP_SHUFFLE_MODE_GROUP 

Group shuffle


Function Documentation

Registers a callback function that will be invoked when the equalizer state is changed by the remote control device.

Since :
2.4
Parameters:
[in]callbackThe callback function to register
[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_NOT_SUPPORTEDNot supported
Precondition:
The Bluetooth service must be initialized by bt_initialize().
See also:
bt_initialize()
bt_avrcp_unset_equalizer_state_changed_cb()
int bt_avrcp_set_repeat_mode_changed_cb ( bt_avrcp_repeat_mode_changed_cb  callback,
void *  user_data 
)

Registers a callback function that will be invoked when the repeat mode is changed by the remote control device.

Since :
2.4
Parameters:
[in]callbackThe callback function to register
[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_NOT_SUPPORTEDNot supported
Precondition:
The Bluetooth service must be initialized by bt_initialize().
See also:
bt_initialize()
bt_avrcp_unset_repeat_mode_changed_cb()
int bt_avrcp_set_scan_mode_changed_cb ( bt_avrcp_scan_mode_changed_cb  callback,
void *  user_data 
)

Registers a callback function that will be invoked when the scan mode is changed by the remote control device.

Since :
2.4
Parameters:
[in]callbackThe callback function to register
[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_NOT_SUPPORTEDNot supported
Precondition:
The Bluetooth service must be initialized by bt_initialize().
See also:
bt_initialize()
bt_avrcp_unset_scan_mode_changed_cb()

Registers a callback function that will be invoked when the shuffle mode is changed by the remote control device.

Since :
2.4
Parameters:
[in]callbackThe callback function to register
[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_NOT_SUPPORTEDNot supported
Precondition:
The Bluetooth service must be initialized by bt_initialize().
See also:
bt_initialize()
bt_avrcp_unset_shuffle_mode_changed_cb()

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

Since :
2.4
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_target_initialize().
See also:
bt_avrcp_target_initialize()

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

Since :
2.4
Remarks:
This function must be called before Bluetooth AVRCP service.
You must free all resources of the this service by calling bt_avrcp_target_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_target_deinitialize()

Notifies the equalize state to the remote device.

Since :
2.4
Privilege Level:
public
Privilege:
http://tizen.org/privilege/bluetooth
Parameters:
[in]stateThe state of equalizer
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()

Notifies the player state to the remote device.

Since :
2.4
Privilege Level:
public
Privilege:
http://tizen.org/privilege/bluetooth
Parameters:
[in]stateThe player state
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()
int bt_avrcp_target_notify_position ( unsigned int  position)

Notifies the current position of song to the remote device.

Since :
2.4
Privilege Level:
public
Privilege:
http://tizen.org/privilege/bluetooth
Parameters:
[in]positionThe current 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_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()

Notifies the repeat mode to the remote device.

Since :
2.4
Privilege Level:
public
Privilege:
http://tizen.org/privilege/bluetooth
Parameters:
[in]modeThe repeat mode
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()

Notifies the scan mode to the remote device.

Since :
2.4
Privilege Level:
public
Privilege:
http://tizen.org/privilege/bluetooth
Parameters:
[in]modeThe scan mode
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()

Notifies the shuffle mode to the remote device.

Since :
2.4
Privilege Level:
public
Privilege:
http://tizen.org/privilege/bluetooth
Parameters:
[in]modeThe repeat mode
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()
int bt_avrcp_target_notify_track ( const char *  title,
const char *  artist,
const char *  album,
const char *  genre,
unsigned int  track_num,
unsigned int  total_tracks,
unsigned int  duration 
)

Notifies the track to the remote device.

Since :
2.4
Privilege Level:
public
Privilege:
http://tizen.org/privilege/bluetooth
Parameters:
[in]titleThe title of track
[in]artistThe artist of track
[in]albumThe album of track
[in]genreThe genre of track
[in]track_numThe track number
[in]total_tracksThe number of all tracks
[in]durationThe duration of track 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_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()

Unregisters a callback function that will be invoked when the equalizer state is changed by the remote control device.

Since :
2.4
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 service must be initialized by bt_initialize().
See also:
bt_initialize()
bt_avrcp_set_equalizer_state_changed_cb()

Unregisters a callback function that will be invoked when the repeat mode is changed by the remote control device.

Since :
2.4
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 service must be initialized by bt_initialize().
See also:
bt_initialize()
bt_avrcp_set_repeat_mode_changed_cb()

Unregisters a callback function that will be invoked when the scan mode is changed by the remote control device.

Since :
2.4
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 service must be initialized by bt_initialize().
See also:
bt_initialize()
bt_avrcp_set_scan_mode_changed_cb()

Unregisters a callback function that will be invoked when the shuffle mode is changed by the remote control device.

Since :
2.4
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 service must be initialized by bt_initialize().
See also:
bt_initialize()
bt_avrcp_set_shuffle_mode_changed_cb()