Tizen(Headless) Native API  6.5
Bluetooth AVRCP

Bluetooth AVRCP(Audio/Video Remote Control Profile) API provides functions for notifying the change of target device to the control device(Target role) and functions for controlling the remote device(Controller role).

Required Header

#include <bluetooth.h>

Overview

AVRCP profile let users send AV control signals and information between two devices.

Functions

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. (e.g., by a TV remote control or other input devices).
int bt_avrcp_unset_equalizer_state_changed_cb (void)
 Unregisters a callback function that will be invoked when the equalizer state is changed. (e.g., by a TV remote control or other input devices).
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. (e.g., by a TV remote control or other input devices).
int bt_avrcp_unset_repeat_mode_changed_cb (void)
 Unregisters a callback function that will be invoked when the repeat mode is changed. (e.g., by a TV remote control or other input devices).
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. (e.g., by a TV remote control or other input devices).
int bt_avrcp_unset_shuffle_mode_changed_cb (void)
 Unregisters a callback function that will be invoked when the shuffle mode is changed. (e.g., by a TV remote control or other input devices).
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. (e.g., by a TV remote control or other input devices).
int bt_avrcp_unset_scan_mode_changed_cb (void)
 Unregisters a callback function that will be invoked when the scan mode is changed. (e.g., by a TV remote control or other input devices).
int bt_avrcp_set_position_changed_cb (bt_avrcp_position_changed_cb callback, void *user_data)
 Registers a callback function that will be invoked when the song position is changed. (e.g., by a TV remote control or other input devices).
int bt_avrcp_unset_position_changed_cb (void)
 Unregisters a callback function that will be invoked when the song position is changed. (e.g., by a TV remote control or other input devices).
int bt_avrcp_set_play_status_changed_cb (bt_avrcp_play_status_changed_cb callback, void *user_data)
 Registers a callback function that will be invoked when the Play status is changed. (e.g., by a TV remote control or other input devices).
int bt_avrcp_unset_play_status_changed_cb (void)
 Unregisters a callback function that will be invoked when the Play status is changed. (e.g., by a TV remote control or other input devices).
int bt_avrcp_set_track_info_changed_cb (bt_avrcp_track_info_changed_cb callback, void *user_data)
 Registers a callback function that will be invoked when the track metadata is changed. (e.g., by a TV remote control or other input devices).
int bt_avrcp_unset_track_info_changed_cb (void)
 Unregisters a callback function that will be invoked when the track metadata is changed. (e.g., by a TV remote control or other input devices).

Typedefs

typedef void(* bt_avrcp_control_connection_state_changed_cb )(bool connected, const char *remote_address, void *user_data)
 Called when the connection state is changed.
typedef void(* bt_avrcp_position_changed_cb )(unsigned int position, void *user_data)
 Called when the Song position mode is changed by the remote target device.
typedef void(* bt_avrcp_track_info_changed_cb )(bt_avrcp_metadata_attributes_info_s *track, void *user_data)
 Called when the Song metadata information is changed by the remote target device.
typedef void(* bt_avrcp_play_status_changed_cb )(bt_avrcp_player_state_e play_state, void *user_data)
 Called when the Song Play status mode is changed by the remote target device.
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.

Typedef Documentation

typedef void(* bt_avrcp_control_connection_state_changed_cb)(bool connected, const char *remote_address, void *user_data)

Called when the connection state is changed.

Since :
3.0
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_control_initialize()
bt_avrcp_control_deinitialize()
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_play_status_changed_cb)(bt_avrcp_player_state_e play_state, void *user_data)

Called when the Song Play status mode is changed by the remote target device.

Since :
3.0
Parameters:
[in]play_stateThe song play status
[in]user_dataThe user data passed from the callback registration function
See also:
bt_avrcp_set_play_status_changed_cb()
bt_avrcp_unset_play_status_changed_cb()
typedef void(* bt_avrcp_position_changed_cb)(unsigned int position, void *user_data)

Called when the Song position mode is changed by the remote target device.

Since :
3.0
Parameters:
[in]positionPlayback position in milliseconds. When position is 0 it means the track is starting and when it's greater than or equal to track's duration the track has ended.
[in]user_dataThe user data passed from the callback registration function
See also:
bt_avrcp_set_position_changed_cb()
bt_avrcp_unset_position_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]scanThe scan 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()
typedef void(* bt_avrcp_track_info_changed_cb)(bt_avrcp_metadata_attributes_info_s *track, void *user_data)

Called when the Song metadata information is changed by the remote target device.

Since :
3.0
Parameters:
[in]trackThe song metadata information
[in]user_dataThe user data passed from the callback registration function
See also:
bt_avrcp_set_track_info_changed_cb()
bt_avrcp_unset_track_info_changed_cb()

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

Enumeration for the player control commands.

Since :
3.0
Enumerator:
BT_AVRCP_CONTROL_PLAY 

Play

BT_AVRCP_CONTROL_PAUSE 

Pause

BT_AVRCP_CONTROL_STOP 

Stop

BT_AVRCP_CONTROL_NEXT 

Next Track

BT_AVRCP_CONTROL_PREVIOUS 

Previous track

BT_AVRCP_CONTROL_FAST_FORWARD 

Fast Forward

BT_AVRCP_CONTROL_REWIND 

Rewind

Enumerations for the player state.

Since :
3.0
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. (e.g., by a TV remote control or other input devices).

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 AVRCP service must be initialized with bt_avrcp_target_initialize() or bt_avrcp_control_initialize().
See also:
bt_avrcp_target_initialize()
bt_avrcp_control_initialize()
bt_avrcp_unset_equalizer_state_changed_cb()
int bt_avrcp_set_play_status_changed_cb ( bt_avrcp_play_status_changed_cb  callback,
void *  user_data 
)

Registers a callback function that will be invoked when the Play status is changed. (e.g., by a TV remote control or other input devices).

Since :
3.0
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 AVRCP service must be initialized with bt_avrcp_target_initialize() or bt_avrcp_control_initialize().
See also:
bt_avrcp_target_initialize()
bt_avrcp_control_initialize()
bt_avrcp_unset_play_status_changed_cb()
int bt_avrcp_set_position_changed_cb ( bt_avrcp_position_changed_cb  callback,
void *  user_data 
)

Registers a callback function that will be invoked when the song position is changed. (e.g., by a TV remote control or other input devices).

Since :
3.0
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 AVRCP service must be initialized with bt_avrcp_target_initialize() or bt_avrcp_control_initialize().
See also:
bt_avrcp_target_initialize()
bt_avrcp_control_initialize()
bt_avrcp_unset_position_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. (e.g., by a TV remote control or other input devices).

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 AVRCP service must be initialized with bt_avrcp_target_initialize() or bt_avrcp_control_initialize().
See also:
bt_avrcp_target_initialize()
bt_avrcp_control_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. (e.g., by a TV remote control or other input devices).

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 AVRCP service must be initialized with bt_avrcp_target_initialize() or bt_avrcp_control_initialize().
See also:
bt_avrcp_target_initialize()
bt_avrcp_control_initialize()
bt_avrcp_unset_scan_mode_changed_cb()

Registers a callback function that will be invoked when the shuffle mode is changed. (e.g., by a TV remote control or other input devices).

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 AVRCP service must be initialized with bt_avrcp_target_initialize() or bt_avrcp_control_initialize().
See also:
bt_avrcp_target_initialize()
bt_avrcp_control_initialize()
bt_avrcp_unset_shuffle_mode_changed_cb()
int bt_avrcp_set_track_info_changed_cb ( bt_avrcp_track_info_changed_cb  callback,
void *  user_data 
)

Registers a callback function that will be invoked when the track metadata is changed. (e.g., by a TV remote control or other input devices).

Since :
3.0
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 AVRCP service must be initialized with bt_avrcp_target_initialize() or bt_avrcp_control_initialize().
See also:
bt_avrcp_target_initialize()
bt_avrcp_control_initialize()
bt_avrcp_unset_track_info_changed_cb()

Unregisters a callback function that will be invoked when the equalizer state is changed. (e.g., by a TV remote control or other input devices).

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 AVRCP service must be initialized with bt_avrcp_target_initialize() or bt_avrcp_control_initialize().
See also:
bt_avrcp_target_initialize()
bt_avrcp_control_initialize()
bt_avrcp_set_equalizer_state_changed_cb()

Unregisters a callback function that will be invoked when the Play status is changed. (e.g., by a TV remote control or other input devices).

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 AVRCP service must be initialized with bt_avrcp_target_initialize() or bt_avrcp_control_initialize().
See also:
bt_avrcp_target_initialize()
bt_avrcp_control_initialize()
bt_avrcp_set_play_status_changed_cb()

Unregisters a callback function that will be invoked when the song position is changed. (e.g., by a TV remote control or other input devices).

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 AVRCP service must be initialized with bt_avrcp_target_initialize() or bt_avrcp_control_initialize().
See also:
bt_avrcp_target_initialize()
bt_avrcp_control_initialize()
bt_avrcp_set_position_changed_cb()

Unregisters a callback function that will be invoked when the repeat mode is changed. (e.g., by a TV remote control or other input devices).

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 AVRCP service must be initialized with bt_avrcp_target_initialize() or bt_avrcp_control_initialize().
See also:
bt_avrcp_target_initialize()
bt_avrcp_control_initialize()
bt_avrcp_set_repeat_mode_changed_cb()

Unregisters a callback function that will be invoked when the scan mode is changed. (e.g., by a TV remote control or other input devices).

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 AVRCP service must be initialized with bt_avrcp_target_initialize() or bt_avrcp_control_initialize().
See also:
bt_avrcp_target_initialize()
bt_avrcp_control_initialize()
bt_avrcp_set_scan_mode_changed_cb()

Unregisters a callback function that will be invoked when the shuffle mode is changed. (e.g., by a TV remote control or other input devices).

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 AVRCP service must be initialized with bt_avrcp_target_initialize() or bt_avrcp_control_initialize().
See also:
bt_avrcp_target_initialize()
bt_avrcp_control_initialize()
bt_avrcp_set_shuffle_mode_changed_cb()

Unregisters a callback function that will be invoked when the track metadata is changed. (e.g., by a TV remote control or other input devices).

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 AVRCP service must be initialized with bt_avrcp_target_initialize() or bt_avrcp_control_initialize().
See also:
bt_avrcp_target_initialize()
bt_avrcp_control_initialize()
bt_avrcp_set_track_info_changed_cb()