fuchsia.bluetooth.avrcp

PROTOCOLS

PeerManager

Defined in fuchsia.bluetooth.avrcp/controller.fidl

GetControllerForTarget

Returns a controller client to a remote target (TG) service at the peer specified by peer_id. TODO (BT-305): change peer_id to fuchsia.bluetooth.PeerId type after BrEdr profile service switches.

Request

NameType
peer_id string
client request<Controller>

Response

NameType
result PeerManager_GetControllerForTarget_Result

SetAbsoluteVolumeHandler

Set the absolute volume handler for the peer specified at peer_id to handle absolute volume commands and notifications received from the peer. Only one handler may be set with a peer at at time. If a second handler is registered it will be dropped and an error will be returned.

Request

NameType
peer_id string
handler AbsoluteVolumeHandler

Response

NameType
result PeerManager_SetAbsoluteVolumeHandler_Result

AbsoluteVolumeHandler

Defined in fuchsia.bluetooth.avrcp/controller.fidl

Handler for absolute volume requests from a remote peer. See AVRCP v 1.6.2 section 6.13.2. Absolute volume is represented as a percentage using one byte with the most significant bit reserved. 0% is represented as 0x0 and 100% as 0x7f. Volume should scaled between the two values.

SetVolume

Requests that the absolute volume of the player be changed. requested_volume is the requested volume by the peer. Returns the actual volume set locally by the handler.

Request

NameType
requested_volume uint8

Response

NameType
set_volume uint8

OnVolumeChanged

Returns latest volume of the handler to the AVRCP service. This function should return immediately on the first call and if the volume has changed since the last call to this function, otherwise it should only return when the volume has been changed.

Request

NameType

Response

NameType
new_volume uint8

GetCurrentVolume

Returns the current volume immediately.

Request

NameType

Response

NameType
volume uint8

Controller

Defined in fuchsia.bluetooth.avrcp/controller.fidl

Client wrapper for local controller (CT) -> remote target (TG) AVCTP connections between devices. A client is high level construct and does not represent a connection with a device. Connections are internally managed and may be shared by multiple clients. The actual connection may be opened on-demand after any command here is called.

GetPlayerApplicationSettings

Returns the remote PlayerApplicationSettings.

Request

NameType

Response

NameType
result Controller_GetPlayerApplicationSettings_Result

GetMediaAttributes

Returns the currently playing media attributes. May send either the GetElementAttributes or GetItemAttributes command depending on what is supported.

Request

NameType

Response

NameType
result Controller_GetMediaAttributes_Result

SetAbsoluteVolume

Request the absolute volume on the peer be changed. Returns the actual volume set by the peer. Values can range from 0x00 to 0x7F (with 100% volume being 0x7F). You may not get a volume changed notification event from the remote peer as result of changing this.

Request

NameType
requested_volume uint8

Response

NameType
result Controller_SetAbsoluteVolume_Result

InformBatteryStatus

Inform target of the controller's battery level.

Request

NameType
battery_status BatteryStatus

Response

NameType
result Controller_InformBatteryStatus_Result

SetNotificationFilter

Filters notifications that will be received with OnNotification. Not all notifications are supported by all peers. Resetting the notification filter may trigger all requested notification types to post their current value to OnNotification immediately.

The position_change_interval argument is used to set the interval in seconds that the controller client would like to be notified of TRACK_POS_CHANGED events. position_change_interval is ignored if TRACK_POS is not set. The position change interval is best effort and not a guarantee and events may arrive more frequently or less frequently than requested.

Request

NameType
notifications Notifications
position_change_interval uint32

OnNotification

Incoming notification events from the target peer. timestamp is monotonic wall time of when the event was received by the peer. You must call NotifyNotificationHandled after receving a notification event to acknowledge delivery. Multiple non-discrete events may be combined into a single notification if acknowledged after a new event arrives from a peer. Call SetNotificationFilter to set the notifications that are requested of the peer. All notifications are discrete state changes except volume change and position change notifications.

Response

NameType
timestamp int64
notification Notification

NotifyNotificationHandled

Call to acknowledge handling of a notification from OnNotification.

Request

NameType

SetAddressedPlayer

Changes the addressed player_id on the target when multiple are supported.

Request

NameType
player_id uint16

Response

NameType
result Controller_SetAddressedPlayer_Result

SendCommand

Send an AV\C passthrough key command. Sends both a key down and key up event.

Request

NameType
command AvcPanelCommand

Response

NameType
result Controller_SendCommand_Result

STRUCTS

PeerManager_GetControllerForTarget_Response

Defined in fuchsia.bluetooth.avrcp/generated

NameTypeDescriptionDefault

PeerManager_SetAbsoluteVolumeHandler_Response

Defined in fuchsia.bluetooth.avrcp/generated

NameTypeDescriptionDefault

Controller_GetPlayerApplicationSettings_Response

Defined in fuchsia.bluetooth.avrcp/generated

NameTypeDescriptionDefault
settings PlayerApplicationSettings No default

Controller_GetMediaAttributes_Response

Defined in fuchsia.bluetooth.avrcp/generated

NameTypeDescriptionDefault
attributes MediaAttributes No default

Controller_SetAbsoluteVolume_Response

Defined in fuchsia.bluetooth.avrcp/generated

NameTypeDescriptionDefault
set_volume uint8 No default

Controller_InformBatteryStatus_Response

Defined in fuchsia.bluetooth.avrcp/generated

NameTypeDescriptionDefault

Controller_SetAddressedPlayer_Response

Defined in fuchsia.bluetooth.avrcp/generated

NameTypeDescriptionDefault

Controller_SendCommand_Response

Defined in fuchsia.bluetooth.avrcp/generated

NameTypeDescriptionDefault

PlayerApplicationSettings

Defined in fuchsia.bluetooth.avrcp/types.fidl

Defined by AVRCP 1.6.2 Appendix F (player application settings).

NameTypeDescriptionDefault
equalizer bool No default
repeat_status_mode RepeatStatusMode No default
shuffle_mode ShuffleMode No default
scan_mode ScanMode No default

MediaAttributes

Defined in fuchsia.bluetooth.avrcp/types.fidl

Defined by AVRCP 1.6.2 Appendix E (media attributes).

NameTypeDescriptionDefault
title string No default
artist_name string No default
album_name string No default
track_number string No default
total_number_of_tracks string No default
genre string No default
playing_time string No default

ENUMS

ControllerError

Type: uint32

Defined in fuchsia.bluetooth.avrcp/types.fidl

Status codes for commands sent as the controller

NameValueDescription
UNKOWN_FAILURE 1
TIMED_OUT 2
REMOTE_NOT_CONNECTED 3
COMMAND_NOT_IMPLEMENTED 4
COMMAND_REJECTED 5
COMMAND_UNEXPECTED 6
INVALID_ARGUMENTS 7
PACKET_ENCODING 8
PROTOCOL_ERROR 9
CONNECTION_ERROR 10
UNEXPECTED_RESPONSE 11

TargetEvent

Type: uint8

Defined in fuchsia.bluetooth.avrcp/types.fidl

Defined by AVRCP 1.6.2 section 6.7.2 (RegisterNotification) and Appendix H. Style note: named exactly as they are in the specification with the "EVENT_" prefix.

NameValueDescription
PLAYBACK_STATUS_CHANGED 1
TRACK_CHANGED 2
TRACK_REACHED_END 3
TRACK_REACHED_START 4
TRACK_POS_CHANGED 5
BATT_STATUS_CHANGED 6
SYSTEM_STATUS_CHANGED 7
PLAYER_APPLICATION_SETTINGS_CHANGED 8
NOW_PLAYING_CONTENT_CHANGED 9
AVAILABLE_PLAYERS_CHANGED 10
ADDRESSED_PLAYER_CHANGED 11
UIDS_CHANGED 12
VOLUME_CHANGED 13

SystemStatus

Type: uint8

Defined in fuchsia.bluetooth.avrcp/types.fidl

Defined by AVRCP 1.6.2 section 6.7.2 (RegisterNotification). Format for EVENT_SYSTEM_STATUS_CHANGED.

NameValueDescription
POWER_ON 0
POWER_OFF 1
UNPLUGGED 2

PlaybackStatus

Type: uint8

Defined in fuchsia.bluetooth.avrcp/types.fidl

Defined by AVRCP 1.6.2 section 6.7.2 (RegisterNotification). Format for EVENT_PLAYBACK_STATUS_CHANGED.

NameValueDescription
STOPPED 0
PLAYING 1
PAUSED 2
FWD_SEEK 3
REV_SEEK 4
ERROR 255

BatteryStatus

Type: uint8

Defined in fuchsia.bluetooth.avrcp/types.fidl

Defined by AVRCP 1.6.2 section 6.7.2 (RegisterNotification). Format for EVENT_BATT_STATUS_CHANGED. Same encoding also defined by 6.5.8 (InformBatteryStatusOfCT).

NameValueDescription
NORMAL 0
WARNING 1
CRITICAL 2
EXTERNAL 3
FULL_CHARGE 4
RESERVED 5

RepeatStatusMode

Type: uint8

Defined in fuchsia.bluetooth.avrcp/types.fidl

Defined by AVRCP 1.6.2 Appendix F (player application settings).

NameValueDescription
OFF 1
SINGLE_TRACK_REPEAT 2
ALL_TRACK_REPEAT 3
GROUP_REPEAT 4
RESERVED 255

ShuffleMode

Type: uint8

Defined in fuchsia.bluetooth.avrcp/types.fidl

Defined by AVRCP 1.6.2 Appendix F (player application settings).

NameValueDescription
OFF 1
ALL_TRACK_SHUFFLE 2
GROUP_SHUFFLE 3
RESERVED 255

ScanMode

Type: uint8

Defined in fuchsia.bluetooth.avrcp/types.fidl

Defined by AVRCP 1.6.2 Appendix F (player application settings).

NameValueDescription
OFF 1
ALL_TRACK_SCAN 2
GROUP_SCAN 3
RESERVED 255

AvcPanelCommand

Type: uint8

Defined in fuchsia.bluetooth.avrcp/types.fidl

Defined by AV\C Panel specification.

NameValueDescription
SELECT 0
UP 1
DOWN 2
LEFT 3
RIGHT 4
ROOT_MENU 9
CONTENTS_MENU 11
FAVORITE_MENU 12
EXIT 13
ON_DEMAND_MENU 14
APPS_MENU 15
KEY_0 32
KEY_1 33
KEY_2 34
KEY_3 35
KEY_4 36
KEY_5 37
KEY_6 38
KEY_7 39
KEY_8 40
KEY_9 41
DOT 42
ENTER 43
CHANNEL_UP 48
CHANNEL_DOWN 49
CHANNEL_PREVIOUS 50
INPUT_SELECT 52
INFO 53
HELP 54
PAGE_UP 55
PAGE_DOWN 56
LOCK 58
POWER 64
VOLUME_UP 65
VOLUME_DOWN 66
MUTE 67
PLAY 68
STOP 69
PAUSE 70
RECORD 71
REWIND 72
FAST_FORWARD 73
EJECT 74
FORWARD 75
BACKWARD 76
LIST 77
F1 113
F2 114
F3 115
F4 116
F5 117
F6 118
F7 119
F8 120
F9 121
RED 122
GREEN 123
BLUE 124
YELLOW 125

TABLES

Notification

Defined in fuchsia.bluetooth.avrcp/controller.fidl

Event data from incoming target notifications.

OrdinalNameTypeDescription
1 status PlaybackStatus `EVENT_PLAYBACK_STATUS_CHANGED` event data
2 track_id uint64 `EVENT_TRACK_CHANGED` event data
3 pos uint32 `EVENT_TRACK_POS_CHANGED` event data
4 battery_status BatteryStatus `EVENT_BATT_STATUS_CHANGED` event data
5 system_status SystemStatus `EVENT_SYSTEM_STATUS_CHANGED` event data
6 application_settings PlayerApplicationSettings `EVENT_PLAYER_APPLICATION_SETTINGS_CHANGED` event data
7 player_id uint16 `EVENT_ADDRESSED_PLAYER_CHANGED` event data
8 volume uint8 `EVENT_VOLUME_CHANGED` event data
9 device_connected bool `CONNECTION_CHANGE` event data

UNIONS

PeerManager_GetControllerForTarget_Result

Defined in fuchsia.bluetooth.avrcp/generated

NameTypeDescription
response PeerManager_GetControllerForTarget_Response
err int32

PeerManager_SetAbsoluteVolumeHandler_Result

Defined in fuchsia.bluetooth.avrcp/generated

NameTypeDescription
response PeerManager_SetAbsoluteVolumeHandler_Response
err int32

Controller_GetPlayerApplicationSettings_Result

Defined in fuchsia.bluetooth.avrcp/generated

NameTypeDescription
response Controller_GetPlayerApplicationSettings_Response
err ControllerError

Controller_GetMediaAttributes_Result

Defined in fuchsia.bluetooth.avrcp/generated

NameTypeDescription
response Controller_GetMediaAttributes_Response
err ControllerError

Controller_SetAbsoluteVolume_Result

Defined in fuchsia.bluetooth.avrcp/generated

NameTypeDescription
response Controller_SetAbsoluteVolume_Response
err ControllerError

Controller_InformBatteryStatus_Result

Defined in fuchsia.bluetooth.avrcp/generated

NameTypeDescription
response Controller_InformBatteryStatus_Response
err ControllerError

Controller_SetAddressedPlayer_Result

Defined in fuchsia.bluetooth.avrcp/generated

NameTypeDescription
response Controller_SetAddressedPlayer_Response
err ControllerError

Controller_SendCommand_Result

Defined in fuchsia.bluetooth.avrcp/generated

NameTypeDescription
response Controller_SendCommand_Response
err ControllerError

BITS

Notifications

Type: uint32

NameValueDescription
PLAYBACK_STATUS 1 AVRCP `EVENT_PLAYBACK_STATUS_CHANGED` Notification
TRACK 2 AVRCP `EVENT_TRACK_CHANGED` Notification
TRACK_POS 4 AVRCP `EVENT_TRACK_POS_CHANGED` Notification
BATT_STATUS 8 AVRCP `EVENT_BATT_STATUS_CHANGED` Notification
SYSTEM_STATUS 16 AVRCP `EVENT_SYSTEM_STATUS_CHANGED` Notification
PLAYER_APPLICATION_SETTINGS 32 AVRCP `EVENT_PLAYER_APPLICATION_SETTINGS_CHANGED` Notification
ADDRESSED_PLAYER 64 AVRCP `EVENT_ADDRESSED_PLAYER_CHANGED` Notification
VOLUME 128 AVRCP `EVENT_VOLUME_CHANGED` Notification
CONNECTION 65536 Internal connection change event.