![]() |
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...
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 | 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. |
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 sends 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... | |
| void | bt_avrcp_init (bt_avrcp_init_struct *bt_role) |
| This function initializes the AVRCP context with CT or Target role. More... | |
| void | bt_avrcp_deinit (void) |
| This function removes the role from the AVRCP context. | |
| bt_status_t | bt_avrcp_media_send_play_status_response (uint32_t handle, bt_avrcp_media_play_status_notification_t *data) |
| This function sends notification to the remote device for currenct status of playing media, including SongLength, SongPosition and more. More... | |
| bt_status_t | bt_avrcp_send_abort_data_response (uint32_t handle) |
| This function sends response for the abort continuation pdu. More... | |
| bt_status_t | bt_avrcp_element_metadata_attributes_response (uint32_t handle, bt_avrcp_get_element_attributes_response_t *rsp_data) |
| This function provides metadata attributes to the remote device for some specific element(s). More... | |
| bt_status_t | bt_avrcp_send_capability_response (uint32_t handle, void *response_data_t, bt_avrcp_capability_types_t type) |
| This function sends device/profile capability to the remote device. More... | |
Modules | |
| Define | |
| Struct | |
| 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.
| [in] | handle | is the AVRCP handle for the specified remote device. |
| [in] | pdu_id | is the current PDU id for the corresponding command. |
| 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.
| [out] | handle | is the connection handle of the specified remote device. The handle is only valid when the return value is BT_STATUS_SUCCESS. |
| [in] | address | is a pointer to the remote device's address. |
| 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.
| [in] | handle | is the AVRCP connection handle for the specified remote device. |
| [in] | accept | is whether to accept or reject the remote device's connection request. |
| bt_status_t bt_avrcp_disconnect | ( | uint32_t | handle | ) |
This function disconnects the specified remote device.
| [in] | handle | is the AVRCP handle for the specified remote device. |
| bt_status_t bt_avrcp_element_metadata_attributes_response | ( | uint32_t | handle, |
| bt_avrcp_get_element_attributes_response_t * | rsp_data | ||
| ) |
This function provides metadata attributes to the remote device for some specific element(s).
// bt_avrcp_media_attribute_t : 0x01 : Title, 0x02 : Artist Name, 0x3 : Album Name etc.
| [in] | handle | is the AVRCP connection handle for the specified remote device. |
| [in] | rsp_data | metadata attributes to transfer/send to the remote device: |
| 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.
| [in] | handle | is the AVRCP handle for the specified remote device. |
| [in] | attribute_size | is the total size of the list of attribute ID. |
| [in] | attribute_list | is the list of specified attribute ID. |
| 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.
| [in] | handle | is the AVRCP handle for the specified remote device. |
| [in] | attribute_size | is the total size of the list of media attribute ID. |
| [in] | attribute_list | is the list of media attribute ID. |
| void bt_avrcp_init | ( | bt_avrcp_init_struct * | bt_role | ) |
This function initializes the AVRCP context with CT or Target role.
| [in] | bt_role | is the role. |
| 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.
| [in] | handle | is the AVRCP handle for the specified remote device. |
| bt_status_t bt_avrcp_media_send_play_status_response | ( | uint32_t | handle, |
| bt_avrcp_media_play_status_notification_t * | data | ||
| ) |
This function sends notification to the remote device for currenct status of playing media, including SongLength, SongPosition and more.
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.
| [in] | handle | is the AVRCP connection handle for the specified remote device. |
| [in] | data | notification data to be transfered to the remote device: |
| 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.
| [in] | handle | is the AVRCP handle for the specified remote device. |
| [in] | event_id | is the related AVRCP event ID. |
| [in] | play_back_interval | is the time interval (in seconds) at which the change in playback position is noticed. |
| 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.
| [in] | handle | is the AVRCP handle for the specified remote device. |
| [in] | pdu_id | is the current PDU id for the corresponding command. |
| bt_status_t bt_avrcp_send_abort_data_response | ( | uint32_t | handle | ) |
This function sends response for the abort continuation pdu.
| [in] | handle | is the AVRCP connection handle for the specified remote device. |
| bt_status_t bt_avrcp_send_capability_response | ( | uint32_t | handle, |
| void * | response_data_t, | ||
| bt_avrcp_capability_types_t | type | ||
| ) |
This function sends device/profile capability to the remote device.
bt_avrcp_capability_types_t
| [in] | handle | is the AVRCP connection handle for the specified remote device. |
| [in] | rsp_data | device/profile capability attributes to transfer/send to the remote device: |
| 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.
| [in] | handle | is the AVRCP handle for the specified remote device. |
| [in] | op_id | is the operation ID. |
| [in] | op_state | is the operation state. |
| 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 sends 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.
| [in] | handle | is the AVRCP handle of the remote device. |
| [in] | response | is the type of response. BT_AVRCP_RESPONSE_NOT_IMPLEMENTED or BT_AVRCP_RESPONSE_ACCEPTED or BT_AVRCP_RESPONSE_REJECTED. |
| [in] | op_id | is the corresponding operation ID. |
| [in] | op_state | is the corresponding operation state. BT_AVRCP_OPERATION_STATE_PUSH or #BT_AVRCP_OPERATION_STATE_RELEASE. |
| 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:
| [in] | handle | is the AVRCP handle of the remote device. |
| [in] | rsp_data | is the pointer to the register notification response parameters. |
| 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.
| [in] | handle | is the AVRCP handle of the remote device. |
| [in] | volume | is 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. |
| 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.
| [in] | handle | is the AVRCP handle of the remote device. |
| [in] | volume | is 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. |
| 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.
| [in] | handle | is the AVRCP handle for the specified remote device. |
| [in] | attribute_size | is the total size of the list of attribute value and corresponding attribute ID. |
| [in] | attribute_value_list | is the list of attribute value and corresponding attribute ID. |