Tizen Native API
6.0
|
Bluetooth AVRCP(Audio/Video Remote Control Profile) Target 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:
- http://tizen.org/feature/network.bluetooth.audio.media
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.
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) target service. | |
int | bt_avrcp_target_deinitialize (void) |
Deinitializes the Bluetooth AVRCP (Audio/Video Remote Control Profile) target service. | |
int | bt_avrcp_target_notify_equalizer_state (bt_avrcp_equalizer_state_e state) |
Notifies the equalizer 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. |
Function Documentation
int bt_avrcp_target_deinitialize | ( | void | ) |
Deinitializes the Bluetooth AVRCP (Audio/Video Remote Control Profile) target 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_target_initialize().
- See also:
- bt_avrcp_target_initialize()
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) target service.
- Since :
- 3.0
- Remarks:
- This function must be called before any other AVRCP target functions are called.
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] 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().
Notifies the equalizer state to the remote device.
- Since :
- 3.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/bluetooth
- Parameters:
-
[in] state The state of equalizer
- 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.
Notifies the player state to the remote device.
- Since :
- 3.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/bluetooth
- Parameters:
-
[in] state The player state
- 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_target_notify_position | ( | unsigned int | position | ) |
Notifies the current position of song to the remote device.
- Since :
- 3.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/bluetooth
- Parameters:
-
[in] position The current 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_PERMISSION_DENIED Permission denied BT_ERROR_NOT_SUPPORTED Not supported
- Precondition:
- The remote device must be connected.
Notifies the repeat mode to the remote device.
- Since :
- 3.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/bluetooth
- Parameters:
-
[in] mode The repeat mode
- 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_target_notify_scan_mode | ( | bt_avrcp_scan_mode_e | mode | ) |
Notifies the scan mode to the remote device.
- Since :
- 3.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/bluetooth
- Parameters:
-
[in] mode The scan mode
- 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.
Notifies the shuffle mode to the remote device.
- Since :
- 3.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/bluetooth
- Parameters:
-
[in] mode The repeat mode
- 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_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 :
- 3.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/bluetooth
- Parameters:
-
[in] title The title of track [in] artist The artist of track [in] album The album of track [in] genre The genre of track [in] track_num The track number [in] total_tracks The number of all tracks [in] duration The duration of track 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_PERMISSION_DENIED Permission denied BT_ERROR_NOT_SUPPORTED Not supported
- Precondition:
- The remote device must be connected.