Zephyr API Documentation 4.1.99
A Scalable Open Source RTOS
 4.1.99
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
avrcp.h File Reference

Audio Video Remote Control Profile header. More...

Go to the source code of this file.

Data Structures

struct  bt_avrcp_unit_info_rsp
 
struct  bt_avrcp_subunit_info_rsp
 
struct  bt_avrcp_passthrough_rsp
 
struct  bt_avrcp_cb
 

Enumerations

enum  bt_avrcp_ctype_t {
  BT_AVRCP_CTYPE_CONTROL = 0x0 , BT_AVRCP_CTYPE_STATUS = 0x1 , BT_AVRCP_CTYPE_SPECIFIC_INQUIRY = 0x2 , BT_AVRCP_CTYPE_NOTIFY = 0x3 ,
  BT_AVRCP_CTYPE_GENERAL_INQUIRY = 0x4
}
 AV/C command types. More...
 
enum  bt_avrcp_rsp_t {
  BT_AVRCP_RSP_NOT_IMPLEMENTED = 0x8 , BT_AVRCP_RSP_ACCEPTED = 0x9 , BT_AVRCP_RSP_REJECTED = 0xa , BT_AVRCP_RSP_IN_TRANSITION = 0xb ,
  BT_AVRCP_RSP_IMPLEMENTED = 0xc , BT_AVRCP_RSP_STABLE = 0xc , BT_AVRCP_RSP_CHANGED = 0xd , BT_AVRCP_RSP_INTERIM = 0xf
}
 AV/C response codes. More...
 
enum  bt_avrcp_opid_t {
  BT_AVRCP_OPID_SELECT = 0x00 , BT_AVRCP_OPID_UP = 0x01 , BT_AVRCP_OPID_DOWN = 0x02 , BT_AVRCP_OPID_LEFT = 0x03 ,
  BT_AVRCP_OPID_RIGHT = 0x04 , BT_AVRCP_OPID_RIGHT_UP = 0x05 , BT_AVRCP_OPID_RIGHT_DOWN = 0x06 , BT_AVRCP_OPID_LEFT_UP = 0x07 ,
  BT_AVRCP_OPID_LEFT_DOWN = 0x08 , BT_AVRCP_OPID_ROOT_MENU = 0x09 , BT_AVRCP_OPID_SETUP_MENU = 0x0a , BT_AVRCP_OPID_CONTENTS_MENU = 0x0b ,
  BT_AVRCP_OPID_FAVORITE_MENU = 0x0c , BT_AVRCP_OPID_EXIT = 0x0d , BT_AVRCP_OPID_0 = 0x20 , BT_AVRCP_OPID_1 = 0x21 ,
  BT_AVRCP_OPID_2 = 0x22 , BT_AVRCP_OPID_3 = 0x23 , BT_AVRCP_OPID_4 = 0x24 , BT_AVRCP_OPID_5 = 0x25 ,
  BT_AVRCP_OPID_6 = 0x26 , BT_AVRCP_OPID_7 = 0x27 , BT_AVRCP_OPID_8 = 0x28 , BT_AVRCP_OPID_9 = 0x29 ,
  BT_AVRCP_OPID_DOT = 0x2a , BT_AVRCP_OPID_ENTER = 0x2b , BT_AVRCP_OPID_CLEAR = 0x2c , BT_AVRCP_OPID_CHANNEL_UP = 0x30 ,
  BT_AVRCP_OPID_CHANNEL_DOWN = 0x31 , BT_AVRCP_OPID_PREVIOUS_CHANNEL = 0x32 , BT_AVRCP_OPID_SOUND_SELECT = 0x33 , BT_AVRCP_OPID_INPUT_SELECT = 0x34 ,
  BT_AVRCP_OPID_DISPLAY_INFORMATION = 0x35 , BT_AVRCP_OPID_HELP = 0x36 , BT_AVRCP_OPID_PAGE_UP = 0x37 , BT_AVRCP_OPID_PAGE_DOWN = 0x38 ,
  BT_AVRCP_OPID_POWER = 0x40 , BT_AVRCP_OPID_VOLUME_UP = 0x41 , BT_AVRCP_OPID_VOLUME_DOWN = 0x42 , BT_AVRCP_OPID_MUTE = 0x43 ,
  BT_AVRCP_OPID_PLAY = 0x44 , BT_AVRCP_OPID_STOP = 0x45 , BT_AVRCP_OPID_PAUSE = 0x46 , BT_AVRCP_OPID_RECORD = 0x47 ,
  BT_AVRCP_OPID_REWIND = 0x48 , BT_AVRCP_OPID_FAST_FORWARD = 0x49 , BT_AVRCP_OPID_EJECT = 0x4a , BT_AVRCP_OPID_FORWARD = 0x4b ,
  BT_AVRCP_OPID_BACKWARD = 0x4c , BT_AVRCP_OPID_ANGLE = 0x50 , BT_AVRCP_OPID_SUBPICTURE = 0x51 , BT_AVRCP_OPID_F1 = 0x71 ,
  BT_AVRCP_OPID_F2 = 0x72 , BT_AVRCP_OPID_F3 = 0x73 , BT_AVRCP_OPID_F4 = 0x74 , BT_AVRCP_OPID_F5 = 0x75 ,
  BT_AVRCP_OPID_VENDOR_UNIQUE = 0x7e
}
 AV/C operation ids used in AVRCP passthrough commands. More...
 
enum  bt_avrcp_button_state_t { BT_AVRCP_BUTTON_PRESSED = 0 , BT_AVRCP_BUTTON_RELEASED = 1 }
 AVRCP button state flag. More...
 

Functions

struct bt_avrcp * bt_avrcp_connect (struct bt_conn *conn)
 Connect AVRCP.
 
int bt_avrcp_disconnect (struct bt_avrcp *avrcp)
 Disconnect AVRCP.
 
int bt_avrcp_register_cb (const struct bt_avrcp_cb *cb)
 Register callback.
 
int bt_avrcp_get_unit_info (struct bt_avrcp *avrcp)
 Get AVRCP Unit Info.
 
int bt_avrcp_get_subunit_info (struct bt_avrcp *avrcp)
 Get AVRCP Subunit Info.
 
int bt_avrcp_passthrough (struct bt_avrcp *avrcp, bt_avrcp_opid_t operation_id, bt_avrcp_button_state_t state, const uint8_t *payload, uint8_t len)
 Send AVRCP Pass Through command.
 

Detailed Description

Audio Video Remote Control Profile header.

Enumeration Type Documentation

◆ bt_avrcp_button_state_t

AVRCP button state flag.

Enumerator
BT_AVRCP_BUTTON_PRESSED 
BT_AVRCP_BUTTON_RELEASED 

◆ bt_avrcp_ctype_t

AV/C command types.

Enumerator
BT_AVRCP_CTYPE_CONTROL 
BT_AVRCP_CTYPE_STATUS 
BT_AVRCP_CTYPE_SPECIFIC_INQUIRY 
BT_AVRCP_CTYPE_NOTIFY 
BT_AVRCP_CTYPE_GENERAL_INQUIRY 

◆ bt_avrcp_opid_t

AV/C operation ids used in AVRCP passthrough commands.

Enumerator
BT_AVRCP_OPID_SELECT 
BT_AVRCP_OPID_UP 
BT_AVRCP_OPID_DOWN 
BT_AVRCP_OPID_LEFT 
BT_AVRCP_OPID_RIGHT 
BT_AVRCP_OPID_RIGHT_UP 
BT_AVRCP_OPID_RIGHT_DOWN 
BT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_rsp_t

AV/C response codes.

Enumerator
BT_AVRCP_RSP_NOT_IMPLEMENTED 
BT_AVRCP_RSP_ACCEPTED 
BT_AVRCP_RSP_REJECTED 
BT_AVRCP_RSP_IN_TRANSITION 
BT_AVRCP_RSP_IMPLEMENTED 

For SPECIFIC_INQUIRY and GENERAL_INQUIRY commands.

BT_AVRCP_RSP_STABLE 

For STATUS commands.

BT_AVRCP_RSP_CHANGED 
BT_AVRCP_RSP_INTERIM 

Function Documentation

◆ bt_avrcp_connect()

struct bt_avrcp * bt_avrcp_connect ( struct bt_conn * conn)

Connect AVRCP.

This function is to be called after the conn parameter is obtained by performing a GAP procedure. The API is to be used to establish AVRCP connection between devices.

Parameters
connPointer to bt_conn structure.
Returns
pointer to struct bt_avrcp in case of success or NULL in case of error.

◆ bt_avrcp_disconnect()

int bt_avrcp_disconnect ( struct bt_avrcp * avrcp)

Disconnect AVRCP.

This function close AVCTP L2CAP connection.

Parameters
avrcpThe AVRCP instance.
Returns
0 in case of success or error code in case of error.

◆ bt_avrcp_get_subunit_info()

int bt_avrcp_get_subunit_info ( struct bt_avrcp * avrcp)

Get AVRCP Subunit Info.

This function obtains information about the subunit(s) of an AV/C unit. A device with AVRCP may support other subunits than the panel subunit if other profiles co-exist in the device.

Parameters
avrcpThe AVRCP instance.
Returns
0 in case of success or error code in case of error.

◆ bt_avrcp_get_unit_info()

int bt_avrcp_get_unit_info ( struct bt_avrcp * avrcp)

Get AVRCP Unit Info.

This function obtains information that pertains to the AV/C unit as a whole.

Parameters
avrcpThe AVRCP instance.
Returns
0 in case of success or error code in case of error.

◆ bt_avrcp_passthrough()

int bt_avrcp_passthrough ( struct bt_avrcp * avrcp,
bt_avrcp_opid_t operation_id,
bt_avrcp_button_state_t state,
const uint8_t * payload,
uint8_t len )

Send AVRCP Pass Through command.

This function send a pass through command to the remote device. Passsthhrough command is used to transfer user operation information from a CT to Panel subunit of TG.

Parameters
avrcpThe AVRCP instance.
operation_idThe user operation id.
stateThe button state.
payloadThe payload of the pass through command. Should not be NULL if len is not zero.
lenThe length of the payload.
Returns
0 in case of success or error code in case of error.

◆ bt_avrcp_register_cb()

int bt_avrcp_register_cb ( const struct bt_avrcp_cb * cb)

Register callback.

Register AVRCP callbacks to monitor the state and interact with the remote device.

Parameters
cbThe callback function.
Returns
0 in case of success or error code in case of error.