PROTOCOLS
Control
Defined in fuchsia.bluetooth.control/control.fidl
Primary Bluetooth control service to access bluetooth
Connect
Attempt to connect to the remote device_id
.
Request
Name | Type |
---|---|
device_id |
string
|
Response
Name | Type |
---|---|
status |
fuchsia.bluetooth/Status
|
Disconnect
Disconnect a previously-connected device. Note: This does not remove a device bond, see Control::Forget.
Request
Name | Type |
---|---|
device_id |
string
|
Response
Name | Type |
---|---|
status |
fuchsia.bluetooth/Status
|
Forget
Forget device_id
completely, removing all bonding information.
This will disconnect a device if it is connected.
Request
Name | Type |
---|---|
device_id |
string
|
Response
Name | Type |
---|---|
status |
fuchsia.bluetooth/Status
|
GetActiveAdapterInfo
Returns information on the current active adapter, if it exists.
Request
Name | Type |
---|
Response
Name | Type |
---|---|
adapter |
AdapterInfo?
|
GetAdapters
Returns information about all local adapters that are known to the system.
Request
Name | Type |
---|
Response
Name | Type |
---|---|
adapters |
vector<AdapterInfo>?
|
GetKnownRemoteDevices
Retrieve the set of known remote devices. Note: These devices are not guaranteed to still be reachable.
Request
Name | Type |
---|
Response
Name | Type |
---|---|
devices |
vector<RemoteDevice>
|
IsBluetoothAvailable
Returns whether or not Bluetooth is currently available on the system.
Request
Name | Type |
---|
Response
Name | Type |
---|---|
available |
bool
|
OnActiveAdapterChanged
Sent when the active adapter has been updated. If active_adapter
is
null, then no adapter is currently active.
Response
Name | Type |
---|---|
adapter |
AdapterInfo?
|
OnAdapterRemoved
Sent when an adapter with the given identifier
has been removed from
the system.
Response
Name | Type |
---|---|
identifier |
string
|
OnAdapterUpdated
Sent when an adapter has been updated.
Response
Name | Type |
---|---|
adapter |
AdapterInfo
|
OnDeviceRemoved
Sent when a peer is removed.
Response
Name | Type |
---|---|
identifier |
string
|
OnDeviceUpdated
Sent when a peer is updated.
Response
Name | Type |
---|---|
device |
RemoteDevice
|
Pair
Initiate a pairing to the remote id
with the given options
. Returns an error
variant of fuchsia.bluetooth.Status if no connected peer with id
is found or the pairing
procedure fails. If already paired, this will do nothing unless the pairing is over LE and
the PairingOptions.le_security_level is more secure than the current security level.
Request
Name | Type |
---|---|
id |
fuchsia.bluetooth/PeerId
|
options |
PairingOptions
|
Response
Name | Type |
---|---|
status |
fuchsia.bluetooth/Status
|
RequestDiscovery
If discovery
is true, active discovery is requested.
When requesting discovery, general discovery for BR/EDR and LE will be
active and newly discovered devices will be reported via
RemoteDeviceDelegate.OnDeviceUpdate().
Discovery may be active when not reqested.
If an error occurs when starting discovery, it is reflected in status
.
Request
Name | Type |
---|---|
discovery |
bool
|
Response
Name | Type |
---|---|
status |
fuchsia.bluetooth/Status
|
SetActiveAdapter
Sets the local adapter with the given identifier
to act as the backing
adapter for all Bluetooth interfaces.
Request
Name | Type |
---|---|
identifier |
string
|
Response
Name | Type |
---|---|
status |
fuchsia.bluetooth/Status
|
SetDeviceClass
Set the Device Class for the active Bluetooth adapter. Values are defined in https://www.bluetooth.com/specifications/assigned-numbers/baseband
Request
Name | Type |
---|---|
device_class |
DeviceClass
|
Response
Name | Type |
---|---|
status |
fuchsia.bluetooth/Status
|
SetDiscoverable
Set the discoverability of this device.
Request
Name | Type |
---|---|
discoverable |
bool
|
Response
Name | Type |
---|---|
status |
fuchsia.bluetooth/Status
|
SetIOCapabilities
Set local IO Capabilities to use during pairing.
Request
Name | Type |
---|---|
input |
InputCapabilityType
|
output |
OutputCapabilityType
|
SetName
Sets the public Bluetooth name for this device, or resets to the default
name if name
is not present.
Request
Name | Type |
---|---|
name |
string?
|
Response
Name | Type |
---|---|
status |
fuchsia.bluetooth/Status
|
SetPairingDelegate
Registers a delegate to handle pairing requests.
Indicate the capability type of the PairingDelegate using in
and out
.
If your input/output capability is variable, call this function when it
changes to update.
Setting a pairing delegate closes the previously assigned pairing Delegate.
To disable pairing, set delegate
to null.
Request
Name | Type |
---|---|
delegate |
PairingDelegate?
|
Response
Name | Type |
---|---|
success |
bool
|
PairingDelegate
Defined in fuchsia.bluetooth.control/pairing_delegate.fidl
OnLocalKeypress
The delegate can send this event to notify the peer of local keypresses during pairing using PairingMethod.PASSKEY_ENTRY.
Response
Name | Type |
---|---|
device_id |
string
|
keypress |
PairingKeypressType
|
OnPairingComplete
Called if the pairing procedure for the device with the given ID is completed.
This can be due to successful completion or an error (e.g. due to cancellation
by the peer, a timeout, or disconnection) which is indicated by status
.
Request
Name | Type |
---|---|
device_id |
string
|
status |
fuchsia.bluetooth/Status
|
OnPairingRequest
Called for most pairing requests. The delegate must respond with “true” or “false” to either accept or reject the pairing request. If the pairing method requires a passkey this is returned as well.
Any response from this method will be ignored if the OnPairingComplete
event has already been sent for device
.
Request
Name | Type |
---|---|
device |
RemoteDevice
|
method |
PairingMethod
|
displayed_passkey |
string?
|
Response
Name | Type |
---|---|
accept |
bool
|
entered_passkey |
string?
|
OnRemoteKeypress
Called to notify keypresses from the peer device during pairing using PairingMethod.PASSKEY_DISPLAY.
This event is used to provide key press events to the delegate for a responsive user experience as the user types the passkey on the peer device. This event will be called once for each key-press.
Request
Name | Type |
---|---|
device_id |
string
|
keypress |
PairingKeypressType
|
STRUCTS
AdapterInfo
Defined in fuchsia.bluetooth.control/control.fidl
Bluetooth controller and its associated host-subsystem state that is present on the current platform.
Name | Type | Description | Default |
---|---|---|---|
identifier |
string
|
UUID that uniquely identifies this adapter on the current system. |
No default |
technology |
TechnologyType
|
The Bluetooth technologies that are supported by this adapter. |
No default |
address |
string
|
Public Bluetooth device address which can be displayed to the user. |
No default |
state |
AdapterState?
|
The current adapter state. This field is only present when an AdapterInfo
is obtained via the Control and ControlDelegate interfaces. If present,
all optional members of |
No default |
AdapterState
Defined in fuchsia.bluetooth.control/control.fidl
Contains static global information about a local Bluetooth adapter, including its current state. Each adapter instance represents a physical
Name | Type | Description | Default |
---|---|---|---|
local_name |
string?
|
No default | |
discoverable |
fuchsia.bluetooth/Bool?
|
No default | |
discovering |
fuchsia.bluetooth/Bool?
|
No default | |
local_service_uuids |
vector<string>?
|
No default |
BREDRData
Defined in fuchsia.bluetooth.control/bonding.fidl
Name | Type | Description | Default |
---|---|---|---|
address |
string
|
No default | |
piconet_leader |
bool
|
No default | |
services |
vector<string>
|
No default | |
link_key |
LTK?
|
No default |
BondingData
Defined in fuchsia.bluetooth.control/bonding.fidl
Name | Type | Description | Default |
---|---|---|---|
identifier |
string
|
No default | |
local_address |
string
|
No default | |
name |
string?
|
No default | |
le |
LEData?
|
No default | |
bredr |
BREDRData?
|
No default |
DeviceClass
Defined in fuchsia.bluetooth.control/control.fidl
Device Class represents the Major and Minor Device Class and Service Class of an adapter Values are defined in https://www.bluetooth.com/specifications/assigned-numbers/baseband
Name | Type | Description | Default |
---|---|---|---|
value |
uint32
|
No default |
HostData
Defined in fuchsia.bluetooth.control/bonding.fidl
Represents persistent local host data.
Name | Type | Description | Default |
---|---|---|---|
irk |
LocalKey?
|
The local Identity Resolving Key used by a bt-host device to generate Resolvable Private Addresses when privacy is enabled. NOTE: This key is distributed to LE peers during pairing procedures. The client must take care to assign an IRK that consistent with the local bt-host identity. |
No default |
LEConnectionParameters
Defined in fuchsia.bluetooth.control/bonding.fidl
Name | Type | Description | Default |
---|---|---|---|
connection_interval |
uint16
|
No default | |
connection_latency |
uint16
|
No default | |
supervision_timeout |
uint16
|
No default |
LEData
Defined in fuchsia.bluetooth.control/bonding.fidl
Name | Type | Description | Default |
---|---|---|---|
address |
string
|
No default | |
address_type |
AddressType
|
No default | |
connection_parameters |
LEConnectionParameters?
|
No default | |
services |
vector<string>
|
No default | |
ltk |
LTK?
|
No default | |
irk |
RemoteKey?
|
No default | |
csrk |
RemoteKey?
|
No default |
LTK
Defined in fuchsia.bluetooth.control/bonding.fidl
Name | Type | Description | Default |
---|---|---|---|
key |
RemoteKey
|
No default | |
key_size |
uint8
|
No default | |
ediv |
uint16
|
No default | |
rand |
uint64
|
No default |
LocalKey
Defined in fuchsia.bluetooth.control/bonding.fidl
Name | Type | Description | Default |
---|---|---|---|
value |
uint8[16]
|
No default |
RemoteDevice
Defined in fuchsia.bluetooth.control/remote_device.fidl
Represents a remote BR/EDR, LE, or dual-mode BR/EDR/LE device.
Name | Type | Description | Default |
---|---|---|---|
identifier |
string
|
Uniquely identifies this device on the current system. |
No default |
address |
string
|
Bluetooth device address that identifies this remote device. Clients
should display this field to the user when NOTE: Clients should use the |
No default |
technology |
TechnologyType
|
The Bluetooth technologies that are supported by this device. |
No default |
name |
string?
|
The name of the remote device if present or known. |
No default |
appearance |
Appearance
|
The LE appearance property. Present if this is a LE device and the appearance information was obtained over advertising and/or GATT. |
No default |
rssi |
fuchsia.bluetooth/Int8?
|
The most recently obtained advertising signal strength for this device. |
No default |
tx_power |
fuchsia.bluetooth/Int8?
|
The most recently obtained transmission power for this device. |
No default |
connected |
bool
|
Whether or not a BR/EDR and/or LE connection exists between the local adapter and this device. |
No default |
bonded |
bool
|
Whether or not a bond exists between the local adapter and this device. |
No default |
service_uuids |
vector<string>
|
The list of service UUIDs known to be published on this remote device. |
No default |
RemoteKey
Defined in fuchsia.bluetooth.control/bonding.fidl
Name | Type | Description | Default |
---|---|---|---|
security_properties |
SecurityProperties
|
No default | |
value |
uint8[16]
|
No default |
SecurityProperties
Defined in fuchsia.bluetooth.control/bonding.fidl
Name | Type | Description | Default |
---|---|---|---|
authenticated |
bool
|
No default | |
secure_connections |
bool
|
No default | |
encryption_key_size |
uint8
|
No default |
ENUMS
AddressType
Type: uint8
Defined in fuchsia.bluetooth.control/bonding.fidl
Name | Value | Description |
---|---|---|
LE_PUBLIC |
0 |
|
LE_RANDOM |
1 |
|
BREDR |
2 |
Appearance
Type: uint16
Defined in fuchsia.bluetooth.control/remote_device.fidl
Possible values for the LE Appearance property which describes the external appearance of a device at a high level. (See the Bluetooth assigned-numbers document: https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.characteristic.gap.appearance.xml)
Name | Value | Description |
---|---|---|
UNKNOWN |
0 |
|
PHONE |
64 |
|
COMPUTER |
128 |
|
WATCH |
192 |
|
WATCH_SPORTS |
193 |
|
CLOCK |
256 |
|
DISPLAY |
320 |
|
REMOTE_CONTROL |
384 |
|
EYE_GLASSES |
448 |
|
TAG |
512 |
|
KEYRING |
576 |
|
MEDIA_PLAYER |
640 |
|
BARCODE_SCANNER |
704 |
|
THERMOMETER |
768 |
|
THERMOMETER_EAR |
769 |
|
HEART_RATE_SENSOR |
832 |
|
HEART_RATE_SENSOR_BELT |
833 |
|
BLOOD_PRESSURE |
896 |
|
BLOOD_PRESSURE_ARM |
897 |
|
BLOOD_PRESSURE_WRIST |
898 |
|
HID |
960 |
|
HID_KEYBOARD |
961 |
|
HID_MOUSE |
962 |
|
HID_JOYSTICK |
963 |
|
HID_GAMEPAD |
964 |
|
HID_DIGITIZER_TABLET |
965 |
|
HID_CARD_READER |
966 |
|
HID_DIGITAL_PEN |
967 |
|
HID_BARCODE_SCANNER |
968 |
|
GLUCOSE_METER |
1024 |
|
RUNNING_WALKING_SENSOR |
1088 |
|
RUNNING_WALKING_SENSOR_IN_SHOE |
1089 |
|
RUNNING_WALKING_SENSOR_ON_SHOE |
1090 |
|
RUNNING_WALKING_SENSOR_ON_HIP |
1091 |
|
CYCLING |
1152 |
|
CYCLING_COMPUTER |
1153 |
|
CYCLING_SPEED_SENSOR |
1154 |
|
CYCLING_CADENCE_SENSOR |
1155 |
|
CYCLING_POWER_SENSOR |
1156 |
|
CYCLING_SPEED_AND_CADENCE_SENSOR |
1157 |
|
PULSE_OXIMETER |
3136 |
|
PULSE_OXIMETER_FINGERTIP |
3137 |
|
PULSE_OXIMETER_WRIST |
3138 |
|
WEIGHT_SCALE |
3200 |
|
PERSONAL_MOBILITY |
3264 |
|
PERSONAL_MOBILITY_WHEELCHAIR |
3265 |
|
PERSONAL_MOBILITY_SCOOTER |
3266 |
|
GLUCOSE_MONITOR |
3328 |
|
SPORTS_ACTIVITY |
5184 |
|
SPORTS_ACTIVITY_LOCATION_DISPLAY |
5185 |
|
SPORTS_ACTIVITY_LOCATION_AND_NAV_DISPLAY |
5186 |
|
SPORTS_ACTIVITY_LOCATION_POD |
5187 |
|
SPORTS_ACTIVITY_LOCATION_AND_NAV_POD |
5188 |
InputCapabilityType
Type: uint32
Defined in fuchsia.bluetooth.control/pairing_delegate.fidl
Input and Output Capabilities for pairing exchanges. See Volume 3, Part C, Table 5.3 and 5.4
Name | Value | Description |
---|---|---|
NONE |
0 |
|
CONFIRMATION |
1 |
|
KEYBOARD |
2 |
OutputCapabilityType
Type: uint32
Defined in fuchsia.bluetooth.control/pairing_delegate.fidl
Name | Value | Description |
---|---|---|
NONE |
0 |
|
DISPLAY |
1 |
PairingKeypressType
Type: uint32
Defined in fuchsia.bluetooth.control/pairing_delegate.fidl
Name | Value | Description |
---|---|---|
DIGIT_ENTERED |
0 |
The user has entered a single digit. |
DIGIT_ERASED |
1 |
The user has erased a single digit. |
PASSKEY_CLEARED |
2 |
The user has cleared the entire passkey. |
PASSKEY_ENTERED |
3 |
The user has finished entering the passkey. |
PairingMethod
Type: uint32
Defined in fuchsia.bluetooth.control/pairing_delegate.fidl
Different types required by the Security Manager for pairing methods. Bluetooth SIG has different requirements for different device capabilities.
Name | Value | Description |
---|---|---|
CONSENT |
0 |
The user is asked to accept or reject pairing. |
PASSKEY_DISPLAY |
1 |
The user is shown a 6-digit numerical passkey which they must enter on the peer device. |
PASSKEY_COMPARISON |
2 |
The user is shown a 6-digit numerical passkey which will also shown on the peer device. The user must compare the passkeys and accept the pairing if the passkeys match. |
PASSKEY_ENTRY |
3 |
The user is asked to enter a 6-digit passkey. |
PairingSecurityLevel
Type: uint32
Defined in fuchsia.bluetooth.control/pairing_options.fidl
The security level required for this pairing - corresponds to the security levels defined in the Security Manager Protocol in Vol 3, Part H, Section 2.3.1
Name | Value | Description |
---|---|---|
ENCRYPTED |
1 |
Encrypted without MITM protection (unauthenticated) |
AUTHENTICATED |
2 |
Encrypted with MITM protection (authenticated), although this level of security does not fully protect against passive eavesdroppers |
TechnologyType
Type: uint32
Defined in fuchsia.bluetooth.control/remote_device.fidl
Name | Value | Description |
---|---|---|
LOW_ENERGY |
0 |
|
CLASSIC |
1 |
|
DUAL_MODE |
2 |
TABLES
PairingOptions
Defined in fuchsia.bluetooth.control/pairing_options.fidl
Parameters that give a caller more fine-grained control over the pairing process. All of the fields of this table are optional and pairing can still succeed if none of them are set.
Ordinal | Name | Type | Description |
---|---|---|---|
1 | le_security_level |
PairingSecurityLevel
|
Only relevant for LE. If present, determines the Security Manager security level to pair with. If not present, defaults to PairingSecurityLevel.AUTHENTICATED. |
2 | non_bondable |
bool
|
If not present or false, the pairing will default to bondable mode. Otherwise, setting this parameter to true will initiate a non-bondable pairing. TODO(fxbug.dev/42403): Only implemented for LE transport. Support this for BR/EDR. |
3 | transport |
TechnologyType
|
If transport is LOW_ENERGY or CLASSIC, pairing will be performed over the transport corresponding to the specified technology, which must already be connected. If transport is not present or DUAL_MODE, the pairing will be performed over whichever transport is connected, and defaults to LE for dual-mode connections. |