36 #ifndef __BT_AVRCP_H__ 37 #define __BT_AVRCP_H__ 186 #define BT_AVRCP_CONNECT_CNF (BT_MODULE_AVRCP | 0x0000) 187 #define BT_AVRCP_CONNECT_IND (BT_MODULE_AVRCP | 0x0001) 188 #define BT_AVRCP_DISCONNECT_IND (BT_MODULE_AVRCP | 0x0002) 191 #define BT_AVRCP_PASS_THROUGH_CNF (BT_MODULE_AVRCP | 0x0003) 192 #define BT_AVRCP_LIST_APP_SETTING_ATTRIBUTES_CNF (BT_MODULE_AVRCP | 0x0004) 193 #define BT_AVRCP_GET_APP_SETTING_VALUE_CNF (BT_MODULE_AVRCP | 0x0005) 194 #define BT_AVRCP_SET_APP_SETTING_VALUE_CNF (BT_MODULE_AVRCP | 0x0006) 195 #define BT_AVRCP_GET_ELEMENT_ATTRIBUTES_CNF (BT_MODULE_AVRCP | 0x0007) 196 #define BT_AVRCP_EVENT_NOTIFICATION_IND (BT_MODULE_AVRCP | 0x0008) 198 #define BT_AVRCP_REQUEST_CONTINUING_CNF (BT_MODULE_AVRCP | 0x0009) 199 #define BT_AVRCP_ABORT_CONTINUING_CNF (BT_MODULE_AVRCP | 0x000a) 201 #define BT_AVRCP_SET_ABSOLUTE_VOLUME_CNF (BT_MODULE_AVRCP | 0x000b) 203 #define BT_AVRCP_PASS_THROUGH_COMMAND_IND (BT_MODULE_AVRCP | 0x0010) 204 #define BT_AVRCP_SET_ABSOLUTE_VOLUME_COMMAND_IND (BT_MODULE_AVRCP | 0x0011) 205 #define BT_AVRCP_REGISTER_NOTIFICATION_IND (BT_MODULE_AVRCP | 0x0012) 206 #define BT_AVRCP_GET_PLAY_STATUS_NOTIFICATION_IND (BT_MODULE_AVRCP | 0x0013) 207 #define BT_AVRCP_ELEMENT_METADATA_IND (BT_MODULE_AVRCP | 0x0014) 208 #define BT_AVRCP_GET_CAPABILITY_IND (BT_MODULE_AVRCP | 0x0015) 209 #define BT_AVRCP_ELEMENT_METADATA_CONT_IND (BT_MODULE_AVRCP | 0x0016) 210 #define BT_AVRCP_CONTINUATION_ABORT_IND (BT_MODULE_AVRCP | 0x0017) 211 #define BT_STATUS_AVRCP_INVALID_PARAMETER (BT_MODULE_AVRCP | 0x01) 212 #define BT_STATUS_AVRCP_FAILED (BT_MODULE_AVRCP | 0x02) 213 #define BT_STATUS_AVRCP_BUSY (BT_MODULE_AVRCP | 0x03) 214 #define BT_STATUS_AVRCP_LINK_ALREADY_EXISTED (BT_MODULE_AVRCP | 0x04) 215 #define BT_STATUS_AVRCP_SDP_QUERY_FAILED (BT_MODULE_AVRCP | 0x05) 216 #define BT_STATUS_AVRCP_NOT_IMPLEMENTED (BT_MODULE_AVRCP | 0x28) 217 #define BT_STATUS_AVRCP_REJECTED (BT_MODULE_AVRCP | 0x29) 218 #define BT_STATUS_AVRCP_INTERIM (BT_MODULE_AVRCP | 0x2F) 219 #define BT_STATUS_AVRCP_REJECT_INVALID_COMMAND (BT_MODULE_AVRCP | 0x30) 220 #define BT_STATUS_AVRCP_REJECT_INVALID_PARAMETER (BT_MODULE_AVRCP | 0x31) 221 #define BT_STATUS_AVRCP_REJECT_PARAMTER_NOT_FOUND (BT_MODULE_AVRCP | 0x32) 222 #define BT_STATUS_AVRCP_REJECT_INTERNAL_ERROR (BT_MODULE_AVRCP | 0x33) 229 #define BT_AVRCP_OPERATION_ID_SELECT 0x00 230 #define BT_AVRCP_OPERATION_ID_UP 0x01 231 #define BT_AVRCP_OPERATION_ID_DOWN 0x02 232 #define BT_AVRCP_OPERATION_ID_LEFT 0x03 233 #define BT_AVRCP_OPERATION_ID_RIGHT 0x04 234 #define BT_AVRCP_OPERATION_ID_RIGHT_UP 0x05 235 #define BT_AVRCP_OPERATION_ID_RIGHT_DOWN 0x06 236 #define BT_AVRCP_OPERATION_ID_LEFT_UP 0x07 237 #define BT_AVRCP_OPERATION_ID_LEFT_DOWN 0x08 238 #define BT_AVRCP_OPERATION_ID_ROOT_MENU 0x09 239 #define BT_AVRCP_OPERATION_ID_SETUP_MENU 0x0A 240 #define BT_AVRCP_OPERATION_ID_CONTENTS_MENU 0x0B 241 #define BT_AVRCP_OPERATION_ID_FAVORITE_MENU 0x0C 242 #define BT_AVRCP_OPERATION_ID_EXIT 0x0D 244 #define BT_AVRCP_OPERATION_ID_0 0x20 245 #define BT_AVRCP_OPERATION_ID_1 0x21 246 #define BT_AVRCP_OPERATION_ID_2 0x22 247 #define BT_AVRCP_OPERATION_ID_3 0x23 248 #define BT_AVRCP_OPERATION_ID_4 0x24 249 #define BT_AVRCP_OPERATION_ID_5 0x25 250 #define BT_AVRCP_OPERATION_ID_6 0x26 251 #define BT_AVRCP_OPERATION_ID_7 0x27 252 #define BT_AVRCP_OPERATION_ID_8 0x28 253 #define BT_AVRCP_OPERATION_ID_9 0x29 254 #define BT_AVRCP_OPERATION_ID_DOT 0x2A 255 #define BT_AVRCP_OPERATION_ID_ENTER 0x2B 256 #define BT_AVRCP_OPERATION_ID_CLEAR 0x2C 258 #define BT_AVRCP_OPERATION_ID_CHANNEL_UP 0x30 259 #define BT_AVRCP_OPERATION_ID_CHANNEL_DOWN 0x31 260 #define BT_AVRCP_OPERATION_ID_PREVIOUS_CHANNEL 0x32 261 #define BT_AVRCP_OPERATION_ID_SOUND_SELECT 0x33 262 #define BT_AVRCP_OPERATION_ID_INPUT_SELECT 0x34 263 #define BT_AVRCP_OPERATION_ID_DISPLAY_INFO 0x35 264 #define BT_AVRCP_OPERATION_ID_HELP 0x36 265 #define BT_AVRCP_OPERATION_ID_PAGE_UP 0x37 266 #define BT_AVRCP_OPERATION_ID_PAGE_DOWN 0x38 268 #define BT_AVRCP_OPERATION_ID_POWER 0x40 269 #define BT_AVRCP_OPERATION_ID_VOLUME_UP 0x41 270 #define BT_AVRCP_OPERATION_ID_VOLUME_DOWN 0x42 271 #define BT_AVRCP_OPERATION_ID_MUTE 0x43 272 #define BT_AVRCP_OPERATION_ID_PLAY 0x44 273 #define BT_AVRCP_OPERATION_ID_STOP 0x45 274 #define BT_AVRCP_OPERATION_ID_PAUSE 0x46 275 #define BT_AVRCP_OPERATION_ID_RECORD 0x47 276 #define BT_AVRCP_OPERATION_ID_REWIND 0x48 277 #define BT_AVRCP_OPERATION_ID_FAST_FORWARD 0x49 278 #define BT_AVRCP_OPERATION_ID_EJECT 0x4A 279 #define BT_AVRCP_OPERATION_ID_FORWARD 0x4B 280 #define BT_AVRCP_OPERATION_ID_BACKWARD 0x4C 282 #define BT_AVRCP_OPERATION_ID_ANGLE 0x50 283 #define BT_AVRCP_OPERATION_ID_SUBPICTURE 0x51 285 #define BT_AVRCP_OPERATION_ID_F1 0x71 286 #define BT_AVRCP_OPERATION_ID_F2 0x72 287 #define BT_AVRCP_OPERATION_ID_F3 0x73 288 #define BT_AVRCP_OPERATION_ID_F4 0x74 289 #define BT_AVRCP_OPERATION_ID_F5 0x75 291 #define BT_AVRCP_OPERATION_ID_RESERVED 0x7F 292 typedef uint8_t bt_avrcp_operation_id_t; 294 #define BT_AVRCP_FALSE 0 295 #define BT_AVRCP_TRUE 1 301 #define BT_AVRCP_ROLE_CT 0 302 #define BT_AVRCP_ROLE_TG 1 303 #define BT_AVRCP_ROLE_CT_AND_TG 2 304 #define BT_AVRCP_ROLE_UNDEF 255 305 #define BT_AVRCP_MAX_CHANNEL 2 307 typedef uint8_t bt_avrcp_role;
314 #define BT_AVRCP_OPERATION_STATE_PUSH 0 315 #define BT_AVRCP_OPERATION_STATE_RELEASED 1 316 typedef uint8_t bt_avrcp_operation_state_t; 322 #define BT_AVRCP_METADATA_PACKET_TYPE_NON_FRAGMENT 0x00 323 #define BT_AVRCP_METADATA_PACKET_TYPE_START 0x01 324 #define BT_AVRCP_METADATA_PACKET_TYPE_CONTINUE 0x02 325 #define BT_AVRCP_METADATA_PACKET_TYPE_END 0x03 326 typedef uint16_t bt_avrcp_metadata_packet_type_t; 336 BT_AVRCP_PACKET_TYPE_IND_TOTAL
345 #define BT_AVRCP_MEDIA_ATTRIBUTE_TITLE 0x01 346 #define BT_AVRCP_MEDIA_ATTRIBUTE_ARTIST_NAME 0x02 347 #define BT_AVRCP_MEDIA_ATTRIBUTE_ALBUM_NAME 0x03 348 #define BT_AVRCP_MEDIA_ATTRIBUTE_MEDIA_NUMBER 0x04 349 #define BT_AVRCP_MEDIA_ATTRIBUTE_TOTAL_MEDIA_NUMBER 0x05 350 #define BT_AVRCP_MEDIA_ATTRIBUTE_GENRE 0x06 351 #define BT_AVRCP_MEDIA_ATTRIBUTE_PLAYING_TIME 0x07 352 typedef uint32_t bt_avrcp_media_attribute_t; 358 #define BT_AVRCP_EVENT_PLAYBACK_STATUS_CHANGED 0x01 359 #define BT_AVRCP_EVENT_TRACK_CHANGED 0x02 360 #define BT_AVRCP_EVENT_TRACK_REACHED_END 0x03 361 #define BT_AVRCP_EVENT_TRACK_REACHED_START 0x04 362 #define BT_AVRCP_EVENT_PLAYBACK_POS_CHANGED 0x05 363 #define BT_AVRCP_EVENT_BATT_STATUS_CHANGED 0x06 364 #define BT_AVRCP_EVENT_SYSTEM_STATUS_CHANGED 0x07 365 #define BT_AVRCP_EVENT_PLAYER_APP_SETTING_CHANGED 0x08 366 #define BT_AVRCP_EVENT_NOW_PLAYING_CONTENT_CHANGED 0x09 367 #define BT_AVRCP_EVENT_AVAILABLE_PLAYERS_CHANGED 0x0a 368 #define BT_AVRCP_EVENT_ADDRESSED_PLAYER_CHANGED 0x0b 369 #define BT_AVRCP_EVENT_UIDS_CHANGED 0x0c 370 #define BT_AVRCP_EVENT_VOLUME_CHANGED 0x0D 371 typedef uint8_t bt_avrcp_event_t; 377 #define BT_AVRCP_STATUS_SYSTEM_POWER_ON 0x00 378 #define BT_AVRCP_STATUS_SYSTEM_POWER_OFF 0x01 379 #define BT_AVRCP_STATUS_SYSTEM_UNPLUGGED 0x02 385 #define BT_AVRCP_STATUS_BATT_NORMAL 0x00 386 #define BT_AVRCP_STATUS_BATT_WARNING 0x01 387 #define BT_AVRCP_STATUS_BATT_CRITICAL 0x02 388 #define BT_AVRCP_STATUS_BATT_EXTERNAL 0x03 389 #define BT_AVRCP_STATUS_BATT_FULL_CHARGE 0x04 395 #define BT_AVRCP_STATUS_PLAY_STOPPED 0x00 396 #define BT_AVRCP_STATUS_PLAY_PLAYING 0x01 397 #define BT_AVRCP_STATUS_PLAY_PAUSED 0x02 398 #define BT_AVRCP_STATUS_PLAY_FWD_SEEK 0x03 399 #define BT_AVRCP_STATUS_PLAY_REV_SEEK 0x04 400 #define BT_AVRCP_STATUS_PLAY_ERROR 0xFF 403 typedef uint8_t bt_avrcp_status_t; 408 #define BT_AVRCP_PDU_ID_GET_CAPABILITIES 0X10 409 #define BT_AVRCP_PDU_ID_LIST_APP_SETTING_ATTRIBUTES 0X11 410 #define BT_AVRCP_PDU_ID_GET_APP_SETTING_VALUE 0X13 411 #define BT_AVRCP_PDU_ID_SET_APP_SETTING_VALUE 0X14 412 #define BT_AVRCP_PDU_ID_GET_ELEMENT_ATTRIBUTES 0x20 413 #define BT_AVRCP_PDU_ID_GET_PLAY_STATUS 0x30 414 #define BT_AVRCP_PDU_ID_REGISTER_NOTIFICATION 0X31 415 #define BT_AVRCP_PDU_ID_REQUEST_CONTINUING_RSP 0X40 416 #define BT_AVRCP_PDU_ID_ABORT_CONTINUING_RSP 0X41 417 #define BT_AVRCP_PDU_ID_SET_ABSOLUTE_VOLUME 0x50 419 typedef uint8_t bt_avrcp_pdu_id_t; 421 #define BT_AVRCP_RESPONSE_NOT_IMPLEMENTED 0x08 422 #define BT_AVRCP_RESPONSE_ACCEPTED 0x09 423 #define BT_AVRCP_RESPONSE_REJECTED 0x0A 424 #define BT_AVRCP_RESPONSE_CHANGED 0x0D 425 #define BT_AVRCP_RESPONSE_INTERIM 0x0F 426 typedef uint8_t bt_avrcp_response_t; 429 #define BT_AVRCP_EVENT_MEDIA_PLAY_STOPPED 0x00 430 #define BT_AVRCP_EVENT_MEDIA_PLAYING 0x01 431 #define BT_AVRCP_EVENT_MEDIA_PAUSED 0x02 432 #define BT_AVRCP_EVENT_MEDIA_FWD_SEEK 0x03 433 #define BT_AVRCP_EVENT_MEDIA_REV_SEEK 0x04 434 #define BT_AVRCP_EVENT_MEDIA_ERROR 0xFF 439 #define BT_AVRCP_CAPABILITY_COMPANY_ID 0x2 440 #define BT_AVRCP_CAPABILITY_EVENTS_SUPPORTED 0x3 441 typedef uint8_t bt_avrcp_capability_types_t;
443 #define BT_AVRCP_ELEMENT_ATTRIBUTE_MAX_DATA_SIZE 450 446 #define BT_AVRCP_MAX_MEDIA_ATTRIBUTE_LEN 64 507 uint8_t attribute_id;
515 uint8_t attribute_id;
534 uint8_t attribute_id;
594 uint16_t character_set_id;
595 uint16_t attribute_value_length;
607 uint8_t attribute_value[1];
646 uint32_t playback_position;
659 uint16_t parameter_length;
704 bt_avrcp_response_t response_type;
705 uint16_t parameter_length;
710 uint32_t playback_position;
719 uint32_t song_length;
720 uint32_t song_position;
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...
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.
Definition: bt_avrcp.h:728
The struct of BT_AVRCP_EVENT_NOTIFICATION_IND.
Definition: bt_avrcp.h:643
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...
First or only metadata packet.
Definition: bt_avrcp.h:336
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.
void bt_avrcp_init(bt_avrcp_init_struct *bt_role)
This function initializes the AVRCP context with CT or Target role.
The struct of BT_AVRCP_ABORT_CONTINUING_CNF.
Definition: bt_avrcp.h:678
Continuation request, to continue transferring packets.
Definition: bt_avrcp.h:337
uint8_t bt_avrcp_event_t
The event type of register notification.
Definition: bt_avrcp.h:374
The struct of BT_AVRCP_GET_APP_SETTING_VALUE_CNF.
Definition: bt_avrcp.h:560
uint8_t bt_avrcp_status_t
The event type of register notification.
Definition: bt_avrcp.h:406
bt_status_t bt_avrcp_list_app_setting_attributes(uint32_t handle)
This function gets player application attributes supported at TG device.
uint16_t bt_avrcp_metadata_packet_type_t
The packet type to indicate the packet fragmentation state.
Definition: bt_avrcp.h:329
uint8_t bt_avrcp_operation_state_t
The key state type of the operation.
Definition: bt_avrcp.h:319
uint8_t bt_avrcp_operation_id_t
The operation ID type.
Definition: bt_avrcp.h:295
bt_status_t bt_avrcp_connect(uint32_t *handle, const bt_bd_addr_t *address)
This function connects to the specified remote device.
bt_avrcp_pass_through_cnf_t bt_avrcp_pass_through_command_ind_t
The struct for #BT_AVRCP_PASS_THROUGH_CMD.
Definition: bt_avrcp.h:502
bt_status_t bt_avrcp_disconnect(uint32_t handle)
This function disconnects the specified remote device.
bt_avrcp_continuation_data_req_type
Definition: bt_avrcp.h:334
Definition: bt_avrcp.h:461
uint8_t bt_avrcp_pdu_id_t
The type of the PDU ID.
Definition: bt_avrcp.h:422
The struct of sending register notification response parameters.
Definition: bt_avrcp.h:706
The struct of BT_AVRCP_REGISTER_NOTIFICATION_IND.
Definition: bt_avrcp.h:659
The struct of BT_AVRCP_GET_PLAY_STATUS_NOTIFICATION_IND.
Definition: bt_avrcp.h:670
The struct of player application setting value, with attribute ID and the corresponding value...
Definition: bt_avrcp.h:520
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 struct of response data format for BT_AVRCP_EVENT_PLAYER_APP_SETTING_CHANGED. ...
Definition: bt_avrcp.h:635
The struct for BT_AVRCP_CONNECT_CNF.
Definition: bt_avrcp.h:469
uint32_t bt_avrcp_media_attribute_t
The type of media attributes IDs.
Definition: bt_avrcp.h:355
bt_status_t bt_avrcp_send_abort_data_response(uint32_t handle)
This function sends response for the abort continuation pdu.
Indication type, to delete the pending PDU data .
Definition: bt_avrcp.h:338
The parameter of bt_avrcp_get_app_setting_value.
Definition: bt_avrcp.h:511
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...
The struct of BT_AVRCP_SET_APP_SETTING_VALUE_CNF.
Definition: bt_avrcp.h:577
The struct of BT_AVRCP_GET_ELEMENT_ATTRIBUTES_CNF.
Definition: bt_avrcp.h:617
bt_avrcp_connect_cnf_t bt_avrcp_disconnect_ind_t
The struct for BT_AVRCP_DISCONNECT_IND.
Definition: bt_avrcp.h:487
The struct for BT_AVRCP_PASS_THROUGH_CNF.
Definition: bt_avrcp.h:492
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)...
uint8_t bt_bd_addr_t[6]
Address type, defined in Bluetooth core specification version 4.2.
Definition: bt_type.h:180
int32_t bt_status_t
Define the status type, returned from the APIs, and defined as BT_STATUS_XXX.
Definition: bt_type.h:173
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...
uint8_t bt_avrcp_media_play_status_event_t
The event type of register notification.
Definition: bt_avrcp.h:438
bt_avrcp_set_absolute_volume_response_t bt_avrcp_set_absolute_volume_event_t
The struct BT_AVRCP_SET_ABSOLUTE_VOLUME_COMMAND_IND.
Definition: bt_avrcp.h:693
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.
Definition: bt_avrcp.h:612
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...
The parameter of bt_avrcp_get_element_attributes.
Definition: bt_avrcp.h:530
The struct of BT_AVRCP_LIST_APP_SETTING_ATTRIBUTES_CNF.
Definition: bt_avrcp.h:543
bt_status_t bt_avrcp_connect_response(uint32_t handle, bool accept)
This function responds to the specified remote device's incoming connection.
The struct of BT_AVRCP_ELEMENT_METADATA_IND.
Definition: bt_avrcp.h:585
The struct of BT_AVRCP_SET_ABSOLUTE_VOLUME_CNF.
Definition: bt_avrcp.h:685
void bt_avrcp_deinit(void)
This function removes the role from the AVRCP context.
The struct for BT_AVRCP_CONNECT_IND.
Definition: bt_avrcp.h:477
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...
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_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 dev...
The struct to list player application setting attribute.
Definition: bt_avrcp.h:538
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.