PROTOCOLS
BondingDelegate
Defined in fuchsia.bluetooth.host/host.fidl
RestoreBonds
Restores existing bonded devices to the host. An authenticated session will be established for future connections using the provided bonding data.
If bonding data for the LE transport is available, then the host will establish a connection if the peer directs connectable advertisements to us.
If any of the entries in bonds
could not be restored, then they will be returned in
errors
. This can happen for entries that are malformed and for peers that are already
known to the bt-host. An empty errors
list indicates that all bonds were successfully
restored.
Request
Name | Type |
---|---|
bonds |
vector<fuchsia.bluetooth.sys/BondingData>
|
Response
Name | Type |
---|---|
payload |
BondingDelegate_RestoreBonds_Result
|
WatchBonds
Get the next bonding update. The request will hang until the next update.
Request
<EMPTY>
Response
Name | Type |
---|---|
payload |
BondingDelegate_WatchBonds_Result
|
DiscoverySession
Defined in fuchsia.bluetooth.host/host.fidl
A token protocol representing discovery being enabled.
Stop
Closes this DiscoverySession on the server end, ending discovery if this is the last open DiscoverySession. This can be used to synchronize the closure on both ends of the protocol. If synchronization is not required, the DiscoverySession protocol can simply be closed instead.
Request
<EMPTY>
Host
Defined in fuchsia.bluetooth.host/host.fidl
Interface for interacting with a Bluetooth host device (bt-host)
Connect
Establish a BR/EDR and/or LE connection to the peer with identifier id
:
-
If the peer is known to support the BR/EDR transport then a logical link over that transport will be established to the device. If the connection attempt is successful, local services registered using "RequestProfile()" will be available to the peer. Traditional services discovered on the peer will be notified to local services asynchronously.
-
If the peer is known to support the LE transport then a logical link over that transport will be established to the device. If the connection attempt is successful, GATT services in the local database (populated via RequestGattServer()) will become available to the peer. Similarly, remote GATT services that are discovered on the peer will become available to holders of a gatt.Client capability and to device drivers that can bind to the bt-gatt-svc class of devices.
The result of the procedure will be communicated via status
. If the remote device
supports both BR/EDR and LE transports and a link cannot be established over both, then an
error Status will be returned and neither transport will be connected.
Request
Name | Type |
---|---|
id |
fuchsia.bluetooth/PeerId
|
Response
Name | Type |
---|---|
payload |
Host_Connect_Result
|
Disconnect
Terminate all connections (BR/EDR or LE) to the remote peer with identifier id
.
- request
id
The identifier of the peer to disconnect.
- response
status
Contains an error if either LE or BR/EDR transport fails to disconnect. Contains success when both transports are successfully disconnected or if the peer is already disconnected.
Request
Name | Type |
---|---|
id |
fuchsia.bluetooth/PeerId
|
Response
Name | Type |
---|---|
payload |
Host_Disconnect_Result
|
EnableBackgroundScan
Enable or disable a passive LE background scan. When enabled, the bt-host device will continuously perform a passive LE scan in the background when no device discovery sessions are active and accept connection requests from bonded peripherals.
Request
Name | Type |
---|---|
enabled |
bool
|
EnablePrivacy
Enable or disable the LE privacy feature. When enabled, the bt-host device will use a private device address in all LE procedures. When disabled, the public identity address will be used instead (which is the default).
Request
Name | Type |
---|---|
enabled |
bool
|
Forget
Deletes a peer from the Bluetooth host. If the peer is connected, it will be disconnected.
device_id
will no longer refer to any peer, even if a device with the same address is
discovered again.
Returns success after no peer exists that's identified by device_id
(even if it didn't
exist before Forget), failure if the peer specified by device_id
could not be
disconnected or deleted and still exists.
Request
Name | Type |
---|---|
id |
fuchsia.bluetooth/PeerId
|
Response
Name | Type |
---|---|
payload |
Host_Forget_Result
|
Pair
Initiates pairing to the peer with the supplied id
and options
. Returns an error if no
connected peer with id
is found or the pairing procedure fails.
If options
specifies a higher security level than the current pairing, this method
attempts to raise the security level. Otherwise this method has no effect and returns
success.
NOTE: This is intended to satisfy test scenarios that require pairing procedures to be initiated without relying on service access. In normal operation, Bluetooth security is enforced during service access.
Request
Name | Type |
---|---|
id |
fuchsia.bluetooth/PeerId
|
options |
fuchsia.bluetooth.sys/PairingOptions
|
Response
Name | Type |
---|---|
payload |
Host_Pair_Result
|
RequestProtocol
Fulfills a given protocol request. bt-host will start processing FIDL messages. If the request cannot be fulfilled, the bt-host device will close its end of the given channel.
Request
Name | Type |
---|---|
payload |
ProtocolRequest
|
SetBondingDelegate
Set a BondingDelegate protocol that will be notified of new and removed bonds that need to
be persisted. If a delegate is already set, the new delegate
will be closed with
ALREADY_BOUND
Request
Name | Type |
---|---|
delegate |
server_end:BondingDelegate
|
SetBrEdrSecurityMode
Set the GAP BR/EDR Security Mode of the host. bt-host only supports encrypted, connection-based security modes, i.e. Mode 4 and Secure Connections Only mode. If the security mode is set to Secure Connections Only, any existing encrypted connections which do not meet the security requirements of Secure Connections Only mode will be disconnected.
Request
Name | Type |
---|---|
bredr_security_mode |
fuchsia.bluetooth.sys/BrEdrSecurityMode
|
SetConnectable
Sets whether this host should be connectable.
Request
Name | Type |
---|---|
enabled |
bool
|
Response
Name | Type |
---|---|
payload |
Host_SetConnectable_Result
|
SetDeviceClass
Sets the device class for this host device.
Request
Name | Type |
---|---|
device_class |
fuchsia.bluetooth/DeviceClass
|
Response
Name | Type |
---|---|
payload |
Host_SetDeviceClass_Result
|
SetDiscoverable
Sets whether this host should be discoverable.
Request
Name | Type |
---|---|
enabled |
bool
|
Response
Name | Type |
---|---|
payload |
Host_SetDiscoverable_Result
|
SetLeSecurityMode
Set the GAP LE Security Mode of the host. bt-host only supports encrypted, connection-based security modes, i.e. Mode 1 and Secure Connections Only mode. If the security mode is set to Secure Connections Only, any existing encrypted connections which do not meet the security requirements of Secure Connections Only mode will be disconnected.
Request
Name | Type |
---|---|
le_security_mode |
fuchsia.bluetooth.sys/LeSecurityMode
|
SetLocalData
Assigns local data to this host.
Request
Name | Type |
---|---|
payload |
fuchsia.bluetooth.sys/HostData
|
SetLocalName
Sets the local name for this host device.
Request
Name | Type |
---|---|
local_name |
fuchsia.bluetooth/DeviceName
|
Response
Name | Type |
---|---|
payload |
Host_SetLocalName_Result
|
SetPairingDelegate
Assigns the pairing delegate that will respond to authentication challenges using the given I/O capabilities. Calling this method cancels any on-going pairing procedure started using a previous delegate. Pairing requests will be rejected if no PairingDelegate has been assigned.
Request
Name | Type |
---|---|
input |
fuchsia.bluetooth.sys/InputCapability
|
output |
fuchsia.bluetooth.sys/OutputCapability
|
delegate |
client_end:fuchsia.bluetooth.sys/PairingDelegate
|
SetPeerWatcher
Sets a PeerWatcher protocol that will be notified of changes to peers. Only 1 PeerWatcher can be configured at a time.
Request
Name | Type |
---|---|
peer_watcher |
server_end:PeerWatcher
|
Shutdown
Shuts down the host, ending all active Bluetooth procedures:
- All FIDL interface handles associated with this host are closed and all connections initiated via FIDL clients are severed.
- All scan, discovery, and advertising procedures are stopped.
- Bonded devices are cleared and removed from the auto-connect lists.
- Auto-connected peripherals are disconnected.
This effectively resets the host to its initial state and the host remains available for future requests.
The Host will continue to send OnDeviceUpdated events as procedures get terminated.
The Host protocol will close when shutdown is complete.
Request
<EMPTY>
StartDiscovery
Initiates a general discovery procedure for BR/EDR and LE devices. On success, discovered
peers can be monitored using the fuchsia.bluetooth.host/Host.WatchPeers method. On Error,
an epitaph will be returned from token
. If the device does not support BR/EDR, only LE
discovery will be performed.
On the LE transport, only general-discoverable and connectable peripherals will be reported.
Discovery will continue until all discovery sessions are closed.
- request
token
The DiscoverySession protocol that must be held open as long as discovery should be enabled. Closing it will stop discovery if no other sessions are open.
Request
Name | Type |
---|---|
payload |
HostStartDiscoveryRequest
|
WatchState
Returns information about the Bluetooth host subsystem and controller managed by this Host instance. If there has been no change to the state since the last call to this method, the response will be deferred until there is a change.
The returned info
structure will be populated with the current state of the bt-host
device. However the active
parameter will never be populated. This field is managed
by a higher layer.
Request
<EMPTY>
Response
Name | Type |
---|---|
payload |
Host_WatchState_Result
|
PeerWatcher
Defined in fuchsia.bluetooth.host/host.fidl
GetNext
Get the next peer update. The request will hang until the next update.
Request
<EMPTY>
Response
Name | Type |
---|---|
payload |
PeerWatcher_GetNext_Result
|
Receiver
Defined in fuchsia.bluetooth.host/host.fidl
Receives a bt-host by protocol for use in the Bluetooth Host Subsystem
AddHost
Adds a new bt-host. If request
cannot be handled, it should be closed.
Request
Name | Type |
---|---|
request |
client_end:Host
|
STRUCTS
BondingDelegate_RestoreBonds_Response
Defined in fuchsia.bluetooth.host/host.fidl
Field | Type | Description | Default |
---|---|---|---|
errors |
vector<fuchsia.bluetooth.sys/BondingData>
|
No default |
Host_Connect_Response
Defined in fuchsia.bluetooth.host/host.fidl
<EMPTY>
Host_Disconnect_Response
Defined in fuchsia.bluetooth.host/host.fidl
<EMPTY>
Host_Forget_Response
Defined in fuchsia.bluetooth.host/host.fidl
<EMPTY>
Host_Pair_Response
Defined in fuchsia.bluetooth.host/host.fidl
<EMPTY>
Host_SetConnectable_Response
Defined in fuchsia.bluetooth.host/host.fidl
<EMPTY>
Host_SetDeviceClass_Response
Defined in fuchsia.bluetooth.host/host.fidl
<EMPTY>
Host_SetDiscoverable_Response
Defined in fuchsia.bluetooth.host/host.fidl
<EMPTY>
Host_SetLocalName_Response
Defined in fuchsia.bluetooth.host/host.fidl
<EMPTY>
Host_WatchState_Response
Defined in fuchsia.bluetooth.host/host.fidl
Field | Type | Description | Default |
---|---|---|---|
info |
fuchsia.bluetooth.sys/HostInfo
|
No default |
TABLES
HostStartDiscoveryRequest resource
Defined in fuchsia.bluetooth.host/host.fidl
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
token |
server_end:DiscoverySession
|
Required. |
UNIONS
BondingDelegate_RestoreBonds_Result strict
Defined in fuchsia.bluetooth.host/host.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
BondingDelegate_RestoreBonds_Response
|
|
3 |
framework_err |
internal
|
BondingDelegate_WatchBonds_Response flexible
Defined in fuchsia.bluetooth.host/host.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
updated |
fuchsia.bluetooth.sys/BondingData
|
Notifies when bonding data for a peer has been added/updated. |
2 |
removed |
fuchsia.bluetooth/PeerId
|
Notifies when a bond is removed due to authentication failures. |
BondingDelegate_WatchBonds_Result strict
Defined in fuchsia.bluetooth.host/host.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
BondingDelegate_WatchBonds_Response
|
|
3 |
framework_err |
internal
|
Host_Connect_Result strict
Defined in fuchsia.bluetooth.host/host.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
Host_Connect_Response
|
|
2 |
err |
fuchsia.bluetooth.sys/Error
|
|
3 |
framework_err |
internal
|
Host_Disconnect_Result strict
Defined in fuchsia.bluetooth.host/host.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
Host_Disconnect_Response
|
|
2 |
err |
fuchsia.bluetooth.sys/Error
|
|
3 |
framework_err |
internal
|
Host_Forget_Result strict
Defined in fuchsia.bluetooth.host/host.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
Host_Forget_Response
|
|
2 |
err |
fuchsia.bluetooth.sys/Error
|
|
3 |
framework_err |
internal
|
Host_Pair_Result strict
Defined in fuchsia.bluetooth.host/host.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
Host_Pair_Response
|
|
2 |
err |
fuchsia.bluetooth.sys/Error
|
|
3 |
framework_err |
internal
|
Host_SetConnectable_Result strict
Defined in fuchsia.bluetooth.host/host.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
Host_SetConnectable_Response
|
|
2 |
err |
fuchsia.bluetooth.sys/Error
|
|
3 |
framework_err |
internal
|
Host_SetDeviceClass_Result strict
Defined in fuchsia.bluetooth.host/host.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
Host_SetDeviceClass_Response
|
|
2 |
err |
fuchsia.bluetooth.sys/Error
|
|
3 |
framework_err |
internal
|
Host_SetDiscoverable_Result strict
Defined in fuchsia.bluetooth.host/host.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
Host_SetDiscoverable_Response
|
|
2 |
err |
fuchsia.bluetooth.sys/Error
|
|
3 |
framework_err |
internal
|
Host_SetLocalName_Result strict
Defined in fuchsia.bluetooth.host/host.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
Host_SetLocalName_Response
|
|
2 |
err |
fuchsia.bluetooth.sys/Error
|
|
3 |
framework_err |
internal
|
Host_WatchState_Result strict
Defined in fuchsia.bluetooth.host/host.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
Host_WatchState_Response
|
|
3 |
framework_err |
internal
|
PeerWatcher_GetNext_Response flexible
Defined in fuchsia.bluetooth.host/host.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
updated |
vector<fuchsia.bluetooth.sys/Peer>
|
Peers are added and updated as new information is obtained during discovery, connection establishment, and bonding procedures. |
2 |
removed |
vector<fuchsia.bluetooth/PeerId>
|
Peers are removed either: a. explicitly via fuchsia.bluetooth.host.Host/Forget, or b. bt-host has not seen the peer recently and the peer is not bonded or connected |
PeerWatcher_GetNext_Result strict
Defined in fuchsia.bluetooth.host/host.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
PeerWatcher_GetNext_Response
|
|
3 |
framework_err |
internal
|
ProtocolRequest flexible resource
Defined in fuchsia.bluetooth.host/host.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
central |
server_end:fuchsia.bluetooth.le/Central
|
|
2 |
peripheral |
server_end:fuchsia.bluetooth.le/Peripheral
|
|
3 |
gatt_server |
server_end:fuchsia.bluetooth.gatt/Server
|
|
4 |
gatt2_server |
server_end:fuchsia.bluetooth.gatt2/Server
|
|
5 |
profile |
server_end:fuchsia.bluetooth.bredr/Profile
|
|
6 |
privileged_peripheral |
server_end:fuchsia.bluetooth.le/PrivilegedPeripheral
|
Added: 24
|