fuchsia.bluetooth.bredr

PROTOCOLS

ConnectionReceiver

Defined in fuchsia.bluetooth.bredr/profile.fidl

Represents a service which is registered by this profile. Closing this protocol will remove the service registration.

Connected

Called when a peer connects to this service. The channel connected is delivered with parameters in channel. protocol will contain a protocol list up to the point connected (for example, if L2CAP is connected, it will contain the L2CAP protocol and specify the PSM connected)

Request

NameType
peer_id fuchsia.bluetooth/PeerId
channel Channel
protocol ProtocolDescriptorList

SearchResults

Defined in fuchsia.bluetooth.bredr/profile.fidl

Represents an active search which can produce results when peers are connected. Closing this protocol will result in the associated search not being performed on new connected peers.

ServiceFound

Called when a search this client added finds a matching service on a peer. peer_id is the peer the service was found on. protocol includes the ProtocolDescriptorList in the service record if it exists (it is also included in attributes.) attributes contains all attributes requested from the search that are present on the peer record. It may also include additional attributes. Each ServiceFound call should be acknowledged by replying. A limited amount of unacknowledged results will be sent on the channel. Results may be dropped if results are received while too many results are unacknowledged.

Request

NameType
peer_id fuchsia.bluetooth/PeerId
protocol ProtocolDescriptorList
attributes vector<Attribute>[512]

Response

NameType

Profile

Defined in fuchsia.bluetooth.bredr/profile.fidl

Service provides Bluetooth BR/EDR profiles a way to register a service definition, making a profile discoverable by peers. Registered services can receive L2CAP connections made to the advertised records, and can open new connections on peers.

Register a set of services. These services will be discoverable via Service Discovery Protocol server. All services advertising the same channel must be added at once - if services are already registered on any channel advertised, registration will fail and the receiver will be closed with ZX_ERR_ALREADY_BOUND. The ConnectionReceiver will get calls for connections to the channels included in the protocol_descriptor or alternative_protocol_descriptors in the services advertised. The requirements provided here will be attempted with the peer before a connection is established. If a peer cannot provide the requirements before connecting, the connection is closed and nothing is delivered to the receiver. The receiver will be closed if the advertisement cannot be made for any reason with a suitable epitaph.

Request

NameType
services vector<ServiceDefinition>[32]
requirements SecurityRequirements
parameters ChannelParameters
receiver ConnectionReceiver

Register a search for services on newly connected peers. The SearchResults protocol will be used to report results for this search. Any service result with a service matching service_uuid will be returned with the additional attributes in attr_ids. If attr_ids is empty, all attributes will be requested. The additional attribute BLUETOOTH_PROTOCOL_DESCRIPTOR_LIST is always requested. See the Bluetooth Spec v5.2, Vol 3, Part B, Section 5) and relevant profile specification documents.

Request

NameType
service_uuid ServiceClassProfileIdentifier
attr_ids vector<uint16>[512]
results SearchResults

Connect

Connect an L2CAP channel to the connected peer identified by peer_id using the desired channel parameters listed. Dynamic PSMs can be specified for the psm to connect to. See also the defined PSMs in service.fidl Returns the channel connected once established, or an error code if the channel could not be connected.

Request

NameType
peer_id fuchsia.bluetooth/PeerId
psm uint16
parameters ChannelParameters

Response

NameType
result Profile_Connect_Result

STRUCTS

Profile_Connect_Response

Defined in fuchsia.bluetooth.bredr/profile.fidl

NameTypeDescriptionDefault
channel Channel No default

ProtocolDescriptor

Defined in fuchsia.bluetooth.bredr/service.fidl

Identifies a communications protocol along with protocol-specific parameters. Usually used to describe a protocol endpoint in a ProtocolDescriptorList

NameTypeDescriptionDefault
protocol ProtocolIdentifier No default
params vector<DataElement>[255] No default

ProfileDescriptor

Defined in fuchsia.bluetooth.bredr/service.fidl

A description of a profile that this service conforms to. See Bluetooth Specification v5.2 Vol 3, Part B, Section 5.1.11

NameTypeDescriptionDefault
profile_id ServiceClassProfileIdentifier No default
major_version uint8 No default
minor_version uint8 No default

Attribute

Defined in fuchsia.bluetooth.bredr/service.fidl

A generic attribute, used for protocol information;

NameTypeDescriptionDefault
id uint16 No default
element DataElement No default

ENUMS

ChannelMode

Type: uint32

Defined in fuchsia.bluetooth.bredr/profile.fidl

Used to specify preferred and accepted L2CAP channel modes. If the peer rejects a non-BASIC mode, the Bluetooth system will attempt to open the channel in BASIC mode instead. For a description of each mode, see Bluetooth Spec v5.2, Vol 3, Part A, Sec 2.4.

NameValueDescription
BASIC 1
ENHANCED_RETRANSMISSION 2

ProtocolIdentifier

Type: uint16

Defined in fuchsia.bluetooth.bredr/service.fidl

Defined Protocol Identifiers for the Protocol Descriptor We intentionally omit deprecated profile identifiers. From Bluetooth Assigned Numbers: https://www.bluetooth.com/specifications/assigned-numbers/service-discovery

NameValueDescription
SDP 1
RFCOMM 3
ATT 7
OBEX 8
BNEP 15
HIDP 17
HARDCOPY_CONTROL_CHANNEL 18
HARDCOPY_DATA_CHANNEL 20
HARDCOPY_NOTIFICATION 22
AVCTP 23
AVDTP 25
MCAP_CONTROL_CHANNEL 30
MCAP_DATA_CHANNEL 31
L2CAP 256

ServiceClassProfileIdentifier

Type: uint16

Defined in fuchsia.bluetooth.bredr/service.fidl

Identifiers that are valid for Bluetooth Classes / Profiles We intentionally omit classes and profile IDs that are unsupported, deprecated, or reserved for use by Fuchsia Bluetooth. From Bluetooth Assigned Numbers for SDP https://www.bluetooth.com/specifications/assigned-numbers/service-discovery

NameValueDescription
SERIAL_PORT 4353

ServiceDiscoveryService and BrowseGroupDescriptorService claimed by Fuchsia

DIALUP_NETWORKING 4355
OBEX_OBJECT_PUSH 4357
OPEX_FILE_TRANSFER 4358
HEADSET 4360

Headset Profile (HSP)

HEADSET_AUDIO_GATEWAY 4370
HEADSET_HS 4401
AUDIO_SOURCE 4362

Advanced Audio Distribution Profile (A2DP)

AUDIO_SINK 4363
ADVANCED_AUDIO_DISTRIBUTION 4365
AV_REMOTE_CONTROL_TARGET 4364

Audio/Video Remote Control Profile (AVRCP)

AV_REMOTE_CONTROL 4366
AV_REMOTE_CONTROL_CONTROLLER 4367
PANU 4373

Personal Area Networking (PAN)

NAP 4374
GN 4375
HANDSFREE 4382

Basic Printing and Basic Imaging Profiles omitted (unsupported) Hands-Free Profile (HFP)

HANDSFREE_AUDIO_GATEWAY 4383
SIM_ACCESS 4397

Human Interface Device and Hardcopy Cable Replacement Profile omitted (unsupported)

PHONEBOOK_PCE 4398

Phonebook Access Profile (PBAP)

PHONEBOOK_PSE 4399
PHONEBOOK 4400
MESSAGE_ACCESS_SERVER 4402

Message Access Profile (MAP)

MESSAGE_NOTIFICATION_SERVER 4403
MESSAGE_ACCESS_PROFILE 4404
MPS_PROFILE 4410

GNSS and 3DSP omitted (unsupported) Multi-Profile Specification (MPS)

MPS_CLASS 4411
VIDEO_SOURCE 4867

Calendar, Task, and Notes Profile omitted (unsupported) Device ID used by Fuchsia Video Distribution Profile (VDP)

VIDEO_SINK 4868
VIDEO_DISTRIBUTION 4869
HDP 5120

Health Device Profile (HDP)

HDP_SOURCE 5121
HDP_SINK 5122

TABLES

SecurityRequirements

Defined in fuchsia.bluetooth.bredr/profile.fidl

Authentication and permission requirements to access an advertised service.

OrdinalNameTypeDescription
1 authentication_required bool

If present and true, the physical link must be authenticated with man-in-the-middle attack protection to access this service. If missing, authentication is not required.

2 secure_connections_required bool

If present and true, the physical link must be encrypted with a Secure Connections key to access this service if the host is capable. Advertisement will fail if the host does not support Secure Connections. See Bluetooth Spec v5.2, Vol 3, Part C, Sec 5.2.2.8.

ChannelParameters

Defined in fuchsia.bluetooth.bredr/profile.fidl

Used to specify preferred L2CAP channel parameters.

OrdinalNameTypeDescription
1 channel_mode ChannelMode

Optional. If not provided, BASIC will be used.

2 max_rx_sdu_size uint16

Maximum SDU size this profile is capable of accepting. Must be >= 48. Optional. If not provided, the size will be determined by the Bluetooth system. No guarantees are given regarding the size selected.

Channel

Defined in fuchsia.bluetooth.bredr/profile.fidl

Used to return an opened channel. If there was an error in opening the channel, Channel will be empty. Otherwise, all fields will be present.

OrdinalNameTypeDescription
1 socket handle<socket>

Socket interface for sending/receiving SDUs on the channel.

2 channel_mode ChannelMode

Channel mode accepted by the peer.

3 max_tx_sdu_size uint16

Maximum SDU size the peer is capable of accepting.

Information

Defined in fuchsia.bluetooth.bredr/service.fidl

Human-readable information about a service. Strings are encoded in UTF-8. See Bluetooth Specification v5.2 Vol 3, Part B, Sections 5.1.15 through 5.1.17

OrdinalNameTypeDescription
1 language string[2]

Language that the other fields in this table are in. Must be two characters long and a valid ICO 639:1988 identifier. Must be present.

2 name string[1024]

Service name

3 description string[1024]

A human-readable description

4 provider string[1024]

The provider of this service (person or organization)

ServiceDefinition

Defined in fuchsia.bluetooth.bredr/service.fidl

Definition for a service that is to be advertised as available via Bluetooth BR/EDR.

OrdinalNameTypeDescription
1 service_class_uuids vector<fuchsia.bluetooth/Uuid>[255]

UUIDs of service classes that this service record conforms to. This field is required - all advertised services must have at least one service class.

2 protocol_descriptor_list ProtocolDescriptorList

Specification for the primary protocol that can be used to gain access to this service, with their protocol-specific identifiers. This is ordered from lowest level (typically L2CAP) to highest.

3 additional_protocol_descriptor_lists vector<vector>[255]

Additional protocol descriptor lists, if the service requires more channels in addition to the main service.

4 profile_descriptors vector<ProfileDescriptor>[255]

Bluetooth profiles that are supported by this service.

5 information vector<Information>[85]

Human-readable service information, in one or more languages. The first set of information is considered the primary language.

6 additional_attributes vector<Attribute>[65023]

Additional attributes to be included in the Service Definition for specific services or profiles. All of these attributes should have an Attribute ID above 0x0200.

UNIONS

Profile_Connect_Result

Defined in fuchsia.bluetooth.bredr/profile.fidl

NameTypeDescription
response Profile_Connect_Response
err fuchsia.bluetooth/ErrorCode

DataElement

Defined in fuchsia.bluetooth.bredr/service.fidl

A DataElement is one element in a SDP record. SDP attributes and other parameters are expresssed in DataElements.

NameTypeDescription
int8 int8
int16 int16
int32 int32
int64 int64
uint8 uint8
uint16 uint16
uint32 uint32
uint64 uint64
str string[1024]
url fuchsia.url/Url
uuid fuchsia.bluetooth/Uuid
b bool
sequence vector<DataElement>[255]
alternatives vector<DataElement>[255]

CONSTANTS

NameValueTypeDescription
MAX_ATTRIBUTES 512 uint16

Maximum number of attributes returned or allowed in a search request.

MAX_SERVICES_PER_ADVERTISEMENT 32 uint8

Maximum service records that can be advertised at once.

MAX_SEQUENCE_LENGTH 255 uint8

The maximum length that a sequence or set of alternatives supported in a DataElement list. If a list is provided that is longer than this from a peer, it is truncated.

MAX_STRING_LENGTH 1024 uint16

Maximum length of a string that is alowed in a DataElement. If a DataElement string longer than this is sent by a peer it will be truncated.

PSM_SDP 1 uint16

Defined PSMs from the Bluetooth Assigned Numbers https://www.bluetooth.com/specifications/assigned-numbers/logical-link-control Used in DataElement as protocol parameters for L2CAP.

PSM_RFCOMM 3 uint16
PSM_TCSBIN 5 uint16
PSM_TCSBIN_CORDLESS 7 uint16
PSM_BNEP 15 uint16
PSM_HID_CONTROL 17 uint16
PSM_HID_INTERRUPT 19 uint16
PSM_AVCTP 23 uint16
PSM_AVDTP 25 uint16
PSM_AVCTP_BROWSE 27 uint16
PSM_ATT 31 uint16
PSM_3DSP 33 uint16
PSM_LE_IPSP 35 uint16
PSM_OTS 37 uint16
MAX_INFORMATION_COUNT 85 uint8

Maximum number of languages that are supported by SDP at the moment.

ATTR_SERVICE_RECORD_HANDLE 0 uint16

Universal attribute IDs. From the Bluetooth Specification v5.2, Vol 3, Part B

ATTR_SERVICE_CLASS_ID_LIST 1 uint16
ATTR_SERVICE_RECORD_STATE 2 uint16
ATTR_SERVICE_ID 3 uint16
ATTR_PROTOCOL_DESCRIPTOR_LIST 4 uint16
ATTR_ADDITIONAL_PROTOCOL_DESCRIPTOR_LIST 13 uint16
ATTR_BROWSE_GROUP_LIST 5 uint16
ATTR_LANGUAGE_BASE_ATTRIBUTE_ID_LIST 6 uint16
ATTR_SERVICE_INFO_TIME_TO_LIVE 7 uint16
ATTR_SERVICE_AVAILABILITY 8 uint16
ATTR_BLUETOOTH_PROFILE_DESCRIPTOR_LIST 9 uint16
MAX_ADDITIONAL_ATTRIBUTES 65023 uint16

Maximum additional attributes as defined by the spec. All attributes must be above 0x0200 per the Bluetooth Specfication, Ver 5.2 Vol 3, Part B, Section 5

TYPE ALIASES

NameValueDescription
ProtocolDescriptorList vector[MAX_SEQUENCE_LENGTH]

A ProtocolDescriptorList is a list of protocols in a "stack" from lowest to highest, Specifying a specific protocol endpoint that can be connected.