Tizen Native API
3.0
|
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:
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_address The remote address
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
BT_ERROR_NONE Successful BT_ERROR_NOT_INITIALIZED Not initialized BT_ERROR_NOT_SUPPORTED Not supported
- Precondition:
- The Bluetooth audio service must be initialized with bt_avrcp_control_initialize().
- See also:
- bt_avrcp_control_initialize()
int bt_avrcp_control_deinitialize | ( | void | ) |
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_NONE Successful BT_ERROR_NOT_INITIALIZED Not initialized BT_ERROR_NOT_SUPPORTED Not 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_address The remote address
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
BT_ERROR_NONE Successful BT_ERROR_NOT_INITIALIZED Not initialized BT_ERROR_NOT_SUPPORTED Not supported
- Precondition:
- The Bluetooth audio service must be initialized with bt_avrcp_control_initialize().
Frees the track metadata.
- Since :
- 3.0
- Parameters:
-
[in] track The track metadata
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
BT_ERROR_NONE Successful BT_ERROR_NOT_INITIALIZED Not initialized BT_ERROR_INVALID_PARAMETER Invalid parameter BT_ERROR_NOT_SUPPORTED Not supported
- Precondition:
- Track should point to valid metadata address.
int bt_avrcp_control_get_equalizer_state | ( | bt_avrcp_equalizer_state_e * | state | ) |
Gets the the equalizer state of the remote device.
- Since :
- 3.0
- Parameters:
-
[out] state The equalizer state, one of: ON, OFF
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
BT_ERROR_NONE Successful BT_ERROR_NOT_INITIALIZED Not initialized BT_ERROR_INVALID_PARAMETER Invalid parameter BT_ERROR_NOT_ENABLED Not enabled BT_ERROR_OPERATION_FAILED Operation failed BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected BT_ERROR_NOT_SUPPORTED Not supported
- Precondition:
- The remote device must be connected.
int bt_avrcp_control_get_play_status | ( | bt_avrcp_player_state_e * | status | ) |
Gets the play status of the remote device.
- Since :
- 3.0
- Parameters:
-
[out] status The play status, one of: PLAYING, STOPPED...
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
BT_ERROR_NONE Successful BT_ERROR_NOT_INITIALIZED Not initialized BT_ERROR_INVALID_PARAMETER Invalid parameter BT_ERROR_NOT_ENABLED Not enabled BT_ERROR_OPERATION_FAILED Operation failed BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected BT_ERROR_NOT_SUPPORTED Not supported
- Precondition:
- The remote device must be connected.
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] position The position, in milliseconds
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
BT_ERROR_NONE Successful BT_ERROR_NOT_INITIALIZED Not initialized BT_ERROR_INVALID_PARAMETER Invalid parameter BT_ERROR_NOT_ENABLED Not enabled BT_ERROR_OPERATION_FAILED Operation failed BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected BT_ERROR_NOT_SUPPORTED Not supported
- Precondition:
- The remote device must be connected.
int bt_avrcp_control_get_repeat_mode | ( | bt_avrcp_repeat_mode_e * | mode | ) |
Gets the repeat state of the remote device.
- Since :
- 3.0
- Parameters:
-
[out] mode The repeat mode, one of: OFF, SINGLE, ALL
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
BT_ERROR_NONE Successful BT_ERROR_NOT_INITIALIZED Not initialized BT_ERROR_INVALID_PARAMETER Invalid parameter BT_ERROR_NOT_ENABLED Not enabled BT_ERROR_OPERATION_FAILED Operation failed BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected BT_ERROR_NOT_SUPPORTED Not supported
- Precondition:
- The remote device must be connected.
int bt_avrcp_control_get_scan_mode | ( | bt_avrcp_scan_mode_e * | mode | ) |
Gets the scan mode of the remote device.
- Since :
- 3.0
- Parameters:
-
[out] mode The scan mode, one of: OFF, GROUP, ALL
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
BT_ERROR_NONE Successful BT_ERROR_NOT_INITIALIZED Not initialized BT_ERROR_INVALID_PARAMETER Invalid parameter BT_ERROR_NOT_ENABLED Not enabled BT_ERROR_OPERATION_FAILED Operation failed BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected BT_ERROR_NOT_SUPPORTED Not supported
- Precondition:
- The remote device must be connected.
int bt_avrcp_control_get_shuffle_mode | ( | bt_avrcp_shuffle_mode_e * | mode | ) |
Gets the shuffle mode of the remote device.
- Since :
- 3.0
- Parameters:
-
[out] mode The shuffle mode, one of: OFF, GROUP, ALL
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
BT_ERROR_NONE Successful BT_ERROR_NOT_INITIALIZED Not initialized BT_ERROR_INVALID_PARAMETER Invalid parameter BT_ERROR_NOT_ENABLED Not enabled BT_ERROR_OPERATION_FAILED Operation failed BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected BT_ERROR_NOT_SUPPORTED Not supported
- Precondition:
- The remote device must be connected.
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.
- Since :
- 3.0
- Remarks:
- The track must be released using bt_avrcp_control_free_track_info().
- Parameters:
-
[out] track The track metadata
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
BT_ERROR_NONE Successful BT_ERROR_NOT_INITIALIZED Not initialized BT_ERROR_INVALID_PARAMETER Invalid parameter BT_ERROR_NOT_ENABLED Not enabled BT_ERROR_OPERATION_FAILED Operation failed BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected BT_ERROR_NOT_SUPPORTED Not supported
- Precondition:
- The remote device must be connected.
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.
- 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] callback The callback function called when the connection state is changed [in] user_data The user data to be passed to the callback function
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
BT_ERROR_NONE Successful BT_ERROR_NOT_INITIALIZED Not initialized BT_ERROR_INVALID_PARAMETER Invalid parameter BT_ERROR_OPERATION_FAILED Operation failed BT_ERROR_NOT_SUPPORTED Not supported
- Precondition:
- The Bluetooth service must be initialized with bt_initialize().
Sends a command to the target device.
- Since :
- 3.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/bluetooth
- Parameters:
-
[in] cmd The commands, one of: Play, Pause, Next, Rewind
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
BT_ERROR_NONE Successful BT_ERROR_NOT_INITIALIZED Not initialized BT_ERROR_INVALID_PARAMETER Invalid parameter BT_ERROR_NOT_ENABLED Not enabled BT_ERROR_OPERATION_FAILED Operation failed BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected BT_ERROR_PERMISSION_DENIED Permission denied BT_ERROR_NOT_SUPPORTED Not supported
- Precondition:
- The Bluetooth audio service must be initialized with bt_avrcp_control_initialize().
Sends the equalizer state change request to the remote device.
- Since :
- 3.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/bluetooth
- Parameters:
-
[in] state The new equalizer state, one of: ON, OFF
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
BT_ERROR_NONE Successful BT_ERROR_NOT_INITIALIZED Not initialized BT_ERROR_INVALID_PARAMETER Invalid parameter BT_ERROR_NOT_ENABLED Not enabled BT_ERROR_OPERATION_FAILED Operation failed BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected BT_ERROR_PERMISSION_DENIED Permission denied BT_ERROR_NOT_SUPPORTED Not supported
- Precondition:
- The remote device must be connected.
Sends the repeat change request to the remote device.
- Since :
- 3.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/bluetooth
- Parameters:
-
[in] mode The new repeat mode, one of: OFF, SINGLE, ALL
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
BT_ERROR_NONE Successful BT_ERROR_NOT_INITIALIZED Not initialized BT_ERROR_INVALID_PARAMETER Invalid parameter BT_ERROR_NOT_ENABLED Not enabled BT_ERROR_OPERATION_FAILED Operation failed BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected BT_ERROR_PERMISSION_DENIED Permission denied BT_ERROR_NOT_SUPPORTED Not supported
- Precondition:
- The remote device must be connected.
int bt_avrcp_control_set_scan_mode | ( | bt_avrcp_scan_mode_e | mode | ) |
Sends the scan mode change request to the remote device.
- Since :
- 3.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/bluetooth
- Parameters:
-
[in] mode The new scan mode, one of: OFF, GROUP, ALL
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
BT_ERROR_NONE Successful BT_ERROR_NOT_INITIALIZED Not initialized BT_ERROR_INVALID_PARAMETER Invalid parameter BT_ERROR_NOT_ENABLED Not enabled BT_ERROR_OPERATION_FAILED Operation failed BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected BT_ERROR_PERMISSION_DENIED Permission denied BT_ERROR_NOT_SUPPORTED Not supported
- Precondition:
- The remote device must be connected.
Sends the shuffle mode change request to the remote device.
- Since :
- 3.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/bluetooth
- Parameters:
-
[in] mode The new shuffle mode, one of: OFF, GROUP, ALL
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
BT_ERROR_NONE Successful BT_ERROR_NOT_INITIALIZED Not initialized BT_ERROR_INVALID_PARAMETER Invalid parameter BT_ERROR_NOT_ENABLED Not enabled BT_ERROR_OPERATION_FAILED Operation failed BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected BT_ERROR_PERMISSION_DENIED Permission denied BT_ERROR_NOT_SUPPORTED Not supported
- Precondition:
- The remote device must be connected.