MT2523 API Reference  LinkIt SDK v4

The Audio/Video Remote Control Profile (AVRCP) defines the features and procedures to ensure interoperability between Bluetooth devices with audio/video functions. More...

Overview

The Audio/Video Remote Control Profile (AVRCP) defines the features and procedures to ensure interoperability between Bluetooth devices with audio/video functions.

The AVRCP API only supports controller role (CT) in the specification of Audio/Video remote control profile V1.6.0.

Terms and Acronyms

Terms Details
CT Controller role or the device playing the Controller role.
TG Target role or the device playing the Target role.
PDU Protocol Data Unit. In AVRCP, it indicates the data unit for Metadata transfer data.
AV/C The Audio/Video Digital Interface Command set. For more information, please refer to AV/C Digital Interface Command Set.
SDP Service Discovery Protocol. For more information, please refer to SDP in Wikipedia.

How to use this module

Functions

bt_status_t bt_avrcp_connect (uint32_t *handle, const bt_bd_addr_t *address)
 This function connects to the specified remote device. More...
 
bt_status_t bt_avrcp_connect_response (uint32_t handle, bool accept)
 This function responds to the specified remote device's incoming connection. More...
 
bt_status_t bt_avrcp_disconnect (uint32_t handle)
 This function disconnects the specified remote device. More...
 
bt_status_t bt_avrcp_send_pass_through_command (uint32_t handle, bt_avrcp_operation_id_t op_id, bt_avrcp_operation_state_t op_state)
 This function sends pass through command to the specified TG device. More...
 
bt_status_t bt_avrcp_send_pass_through_response (uint32_t handle, bt_avrcp_response_t response, bt_avrcp_operation_id_t op_id, bt_avrcp_operation_state_t op_state)
 This function send pass through response after receiving pass through command from the remote CT device. More...
 
bt_status_t bt_avrcp_list_app_setting_attributes (uint32_t handle)
 This function gets player application attributes supported at TG device. More...
 
bt_status_t bt_avrcp_get_app_setting_value (uint32_t handle, uint16_t attribute_size, bt_avrcp_get_app_setting_value_t *attribute_list)
 This function gets the player application setting values for specified attribute ID at the TG device. More...
 
bt_status_t bt_avrcp_set_app_setting_value (uint32_t handle, uint16_t attribute_size, bt_avrcp_app_setting_value_t *attribute_value_list)
 This function sets the player application setting values to specified attribute ID at the TG device. More...
 
bt_status_t bt_avrcp_get_element_attributes (uint32_t handle, uint16_t attribute_size, bt_avrcp_get_element_attributes_t *attribute_list)
 This function obtains the detailed information on a particular media file playing currently at the TG device. More...
 
bt_status_t bt_avrcp_register_notification (uint32_t handle, bt_avrcp_event_t event_id, uint32_t play_back_interval)
 This function sends a register notification command to the TG device. More...
 
bt_status_t bt_avrcp_request_continuing_response (uint32_t handle, bt_avrcp_pdu_id_t pdu_id)
 This function requests TG device to send continuing response packet for current PDU command. More...
 
bt_status_t bt_avrcp_abort_continuing_response (uint32_t handle, bt_avrcp_pdu_id_t pdu_id)
 This function requests TG device to abort continuing response packet for current PDU command. More...
 
bt_status_t bt_avrcp_set_absolute_volume (uint32_t handle, uint8_t volume)
 This function sets the volume in percentage for the rendering device. More...
 
bt_status_t bt_avrcp_send_set_absoulte_volume_response (uint32_t handle, uint8_t volume)
 This function sends the response after receiving set absolute volume command from CT device. More...
 
bt_status_t bt_avrcp_send_register_notification_response (uint32_t handle, bt_avrcp_send_register_notification_response_t *rsp_data)
 This function sends the register notification response to the CT device. More...
 

Modules

 Define
 
 Struct
 

Function Documentation

bt_status_t bt_avrcp_abort_continuing_response ( uint32_t  handle,
bt_avrcp_pdu_id_t  pdu_id 
)

This function requests TG device to abort continuing response packet for current PDU command.

The function should be called when the packet type of metadata response is start or continue. BT_AVRCP_ABORT_CONTINUING_CNF is sent to the upper layer with the request.

Parameters
[in]handleis the AVRCP handle for the specified remote device.
[in]pdu_idis the current PDU id for the corresponding command.
Returns
BT_STATUS_SUCCESS, the abort continuing command is sent successfully. BT_STATUS_AVRCP_BUSY, the last command did not receive any response. BT_STATUS_AVRCP_INVALID_PARAMETER, the handle is NULL. BT_STATUS_OUT_OF_MEMORY, the TX memory is not enough.
bt_status_t bt_avrcp_connect ( uint32_t *  handle,
const bt_bd_addr_t address 
)

This function connects to the specified remote device.

The BT_AVRCP_CONNECT_CNF event is sent to the upper layer with the connection request result.

Parameters
[out]handleis the connection handle of the specified remote device. The handle is only valid when the return value is BT_STATUS_SUCCESS.
[in]addressis a pointer to the remote device's address.
Returns
BT_STATUS_SUCCESS, the connection request started successfully. BT_STATUS_OUT_OF_MEMORY, not enough memory allocated for the AVRCP. BT_STATUS_AVRCP_LINK_ALREADY_EXISTED, the AVRCP channel already exists.
bt_status_t bt_avrcp_connect_response ( uint32_t  handle,
bool  accept 
)

This function responds to the specified remote device's incoming connection.

The function should be called after BT_AVRCP_CONNECT_IND is received. The BT_AVRCP_CONNECT_CNF event is sent to the upper layer with the connection request result.

Parameters
[in]handleis the AVRCP connection handle for the specified remote device.
[in]acceptis whether to accept or reject the remote device's connection request.
Returns
BT_STATUS_SUCCESS, successfully responded to the connection request. BT_STATUS_AVRCP_INVALID_PARAMETER, the handle or address is NULL.
bt_status_t bt_avrcp_disconnect ( uint32_t  handle)

This function disconnects the specified remote device.

Parameters
[in]handleis the AVRCP handle for the specified remote device.
Returns
BT_STATUS_SUCCESS, the disconnect request completed successfully. BT_STATUS_AVRCP_INVALID_PARAMETER, the handle is NULL.
bt_status_t bt_avrcp_get_app_setting_value ( uint32_t  handle,
uint16_t  attribute_size,
bt_avrcp_get_app_setting_value_t attribute_list 
)

This function gets the player application setting values for specified attribute ID at the TG device.

BT_AVRCP_GET_APP_SETTING_VALUE_CNF event is sent to the upper layer with the request result.

Parameters
[in]handleis the AVRCP handle for the specified remote device.
[in]attribute_sizeis the total size of the list of attribute ID.
[in]attribute_listis the list of specified attribute ID.
Returns
BT_STATUS_SUCCESS, the get app setting command is sent successfully. BT_STATUS_AVRCP_BUSY, the last command did not receive any response. BT_STATUS_AVRCP_INVALID_PARAMETER, the handle is NULL. BT_STATUS_OUT_OF_MEMORY, the TX memory is not enough.
bt_status_t bt_avrcp_get_element_attributes ( uint32_t  handle,
uint16_t  attribute_size,
bt_avrcp_get_element_attributes_t attribute_list 
)

This function obtains the detailed information on a particular media file playing currently at the TG device.

The event BT_AVRCP_GET_ELEMENT_ATTRIBUTES_CNF is sent to the upper layer with the request result.

Parameters
[in]handleis the AVRCP handle for the specified remote device.
[in]attribute_sizeis the total size of the list of media attribute ID.
[in]attribute_listis the list of media attribute ID.
Returns
BT_STATUS_SUCCESS, the get element attributes command is sent successfully. BT_STATUS_AVRCP_BUSY, the last command did not receive any response. BT_STATUS_AVRCP_INVALID_PARAMETER, the handle is NULL. BT_STATUS_OUT_OF_MEMORY, the TX memory is not enough.
bt_status_t bt_avrcp_list_app_setting_attributes ( uint32_t  handle)

This function gets player application attributes supported at TG device.

BT_AVRCP_LIST_APP_SETTING_ATTRIBUTES_CNF event is sent to the upper layer with the request result.

Parameters
[in]handleis the AVRCP handle for the specified remote device.
Returns
BT_STATUS_SUCCESS, the list app setting command is sent successfully. BT_STATUS_AVRCP_BUSY, the last command did not receive any response. BT_STATUS_AVRCP_INVALID_PARAMETER, the handle is NULL. BT_STATUS_OUT_OF_MEMORY, the TX memory is not enough.
bt_status_t bt_avrcp_register_notification ( uint32_t  handle,
bt_avrcp_event_t  event_id,
uint32_t  play_back_interval 
)

This function sends a register notification command to the TG device.

BT_AVRCP_EVENT_NOTIFICATION_IND event is sent to the upper layer with the request result.

Parameters
[in]handleis the AVRCP handle for the specified remote device.
[in]event_idis the related AVRCP event ID.
[in]play_back_intervalis the time interval (in seconds) at which the change in playback position is noticed.
Returns
BT_STATUS_SUCCESS, the register command is sent successfully. BT_STATUS_AVRCP_BUSY, the last command did not receive any response. BT_STATUS_AVRCP_INVALID_PARAMETER, the handle is NULL. BT_STATUS_OUT_OF_MEMORY, the TX memory is not enough.
bt_status_t bt_avrcp_request_continuing_response ( uint32_t  handle,
bt_avrcp_pdu_id_t  pdu_id 
)

This function requests TG device to send continuing response packet for current PDU command.

The function should be called when the packet type of metadata response is start or continue. The response of current PDU command is sent to the upper layer with the request.

Parameters
[in]handleis the AVRCP handle for the specified remote device.
[in]pdu_idis the current PDU id for the corresponding command.
Returns
BT_STATUS_SUCCESS, the request continuing command is sent successfully. BT_STATUS_AVRCP_BUSY, the last command did not receive any response. BT_STATUS_AVRCP_INVALID_PARAMETER, the handle is NULL. BT_STATUS_OUT_OF_MEMORY, the TX memory is not enough.
bt_status_t bt_avrcp_send_pass_through_command ( uint32_t  handle,
bt_avrcp_operation_id_t  op_id,
bt_avrcp_operation_state_t  op_state 
)

This function sends pass through command to the specified TG device.

BT_AVRCP_PASS_THROUGH_CNF event is sent to the upper layer with the request result.

Parameters
[in]handleis the AVRCP handle for the specified remote device.
[in]op_idis the operation ID.
[in]op_stateis the operation state.
Returns
BT_STATUS_SUCCESS, the pass through command is sent successfully. BT_STATUS_AVRCP_BUSY, the last command did not receive any response. BT_STATUS_AVRCP_INVALID_PARAMETER, the handle is NULL. BT_STATUS_OUT_OF_MEMORY, the TX memory is not enough.
bt_status_t bt_avrcp_send_pass_through_response ( uint32_t  handle,
bt_avrcp_response_t  response,
bt_avrcp_operation_id_t  op_id,
bt_avrcp_operation_state_t  op_state 
)

This function send pass through response after receiving pass through command from the remote CT device.

The function should only be called after BT_AVRCP_PASS_THROUGH_COMMAND_IND is received.

Parameters
[in]handleis the AVRCP handle of the remote device.
[in]responseis the type of response. BT_AVRCP_RESPONSE_NOT_IMPLEMENTED or BT_AVRCP_RESPONSE_ACCEPTED or BT_AVRCP_RESPONSE_REJECTED.
[in]op_idis the corresponding operation ID.
[in]op_stateis the corresponding operation state. BT_AVRCP_OPERATION_STATE_PUSH or #BT_AVRCP_OPERATION_STATE_RELEASE.
Returns
BT_STATUS_SUCCESS, the pass through command is sent successfully. BT_STATUS_AVRCP_INVALID_PARAMETER, the handel is NULL. BT_STATUS_OUT_OF_MEMORY, the TX memory is not enough.
bt_status_t bt_avrcp_send_register_notification_response ( uint32_t  handle,
bt_avrcp_send_register_notification_response_t rsp_data 
)

This function sends the register notification response to the CT device.

The function should only be called in the following two cases:

  1. Register notification command BT_AVRCP_REGISTER_NOTIFICATION_IND is received with valid parameters.
  2. The register notification comman has received and the corresponding registered event happenes.
Parameters
[in]handleis the AVRCP handle of the remote device.
[in]rsp_datais the pointer to the register notification response parameters.
Returns
BT_STATUS_SUCCESS, the register notification response is sent successfully. BT_STATUS_AVRCP_INVALID_PARAMETER, the handle is NULL. #BT_STATUS_OUT_OF_MOMORY, the TX memory is not enough.
bt_status_t bt_avrcp_send_set_absoulte_volume_response ( uint32_t  handle,
uint8_t  volume 
)

This function sends the response after receiving set absolute volume command from CT device.

The function should only be called after BT_AVRCP_SET_ABSOLUTE_VOLUME_COMMAND_IND is received.

Parameters
[in]handleis the AVRCP handle of the remote device.
[in]volumeis the actual volume to set in percentage. TG can accept the assigned volume in #BT_AVRCP_SET_ABSOLUTE_COMMAND_IND command or return the actual set volume value.
Returns
BT_STATUS_SUCCESS, the set absolute volume response is sent successfully. BT_STATUS_AVRCP_INVALID_PARAMETER, the handle is NULL. #BT_STATUS_OUT_OF_MOMORY, the TX memory is not enough.
bt_status_t bt_avrcp_set_absolute_volume ( uint32_t  handle,
uint8_t  volume 
)

This function sets the volume in percentage for the rendering device.

Note that the actual volume level set in the rendering device is returned through the volume field of bt_avrcp_set_absolute_volume_response_t in the event BT_AVRCP_SET_ABSOLUTE_VOLUME_CNF.

Parameters
[in]handleis the AVRCP handle of the remote device.
[in]volumeis the volume to set in percentage. The top bit (bit 7) is reserved. Values ranging from 0x00 to 0x7F specify 0% to 100% of volume. Other values are invalid.
Returns
BT_STATUS_SUCCESS, the set absolute volume command is sent successfully. BT_STATUS_AVRCP_BUSY, the last command did not receive any response. BT_STATUS_AVRCP_INVALID_PARAMETER, the handle is NULL. #BT_STATUS_OUT_OF_MOMORY, the TX memory is not enough.
bt_status_t bt_avrcp_set_app_setting_value ( uint32_t  handle,
uint16_t  attribute_size,
bt_avrcp_app_setting_value_t attribute_value_list 
)

This function sets the player application setting values to specified attribute ID at the TG device.

BT_AVRCP_SET_APP_SETTING_VALUE_CNF event is sent to upper layer with the request result.

Parameters
[in]handleis the AVRCP handle for the specified remote device.
[in]attribute_sizeis the total size of the list of attribute value and corresponding attribute ID.
[in]attribute_value_listis the list of attribute value and corresponding attribute ID.
Returns
BT_STATUS_SUCCESS, the set app setting command is sent successfully. BT_STATUS_AVRCP_BUSY, the last command did not receive any response. BT_STATUS_AVRCP_INVALID_PARAMETER, the handle is NULL. BT_STATUS_OUT_OF_MEMORY, the TX memory is not enough.