fuchsia.bluetooth.le

PROTOCOLS

Central

Defined in fuchsia.bluetooth.le/central.fidl

GetPeripherals

Request

NameType
service_uuids vector<string>?

Response

NameType
peripherals vector<RemoteDevice>

GetPeripheral

Request

NameType
identifier string

Response

NameType
peripheral RemoteDevice?

StartScan

Request

NameType
filter ScanFilter?

Response

NameType
status fuchsia.bluetooth/Status

StopScan

Request

NameType

ConnectPeripheral

Request

NameType
identifier string
gatt_client request<fuchsia.bluetooth.gatt/Client>

Response

NameType
status fuchsia.bluetooth/Status

DisconnectPeripheral

Request

NameType
identifier string

Response

NameType
status fuchsia.bluetooth/Status

OnScanStateChanged

Response

NameType
scanning bool

OnDeviceDiscovered

Response

NameType
device RemoteDevice

OnPeripheralDisconnected

Response

NameType
identifier string

Connection

Defined in fuchsia.bluetooth.le/peer.fidl

Protocol that represents the connection to a peer. This can be used to interact with GATT services and establish L2CAP channels.

AdvertisingHandle

Defined in fuchsia.bluetooth.le/peripheral.fidl

Capability that is valid for the duration of advertising. The caller can close the handle to stop advertising. If the system internally stops advertising for any reason, the handle will be closed to communicate this to the client.

Peripheral

Defined in fuchsia.bluetooth.le/peripheral.fidl

StartAdvertising

Start advertising as a LE peripheral. An empty response is sent to indicate when advertising has successfully initiated. If advertising cannot be initiated, then the response will contain a PeripheralError.

This method can get called any number of times and successive calls can be made to reconfigure the advertising parameters. However only the most recent AdvertisingHandle will remain valid.

An instance of Peripheral can only have one active advertisement at a time. Clients must obtain multiple Peripheral instances for multiple simultaneous advertisements.

If the client closes its end of the AdvertisingHandle channel, advertising will be stopped. If the handle is closed before the request is fulfilled, advertising will be briefly enabled before it is terminated.

  • request parameters Parameters used while configuring the advertising instance.
  • request handle Handle that remains valid for the duration of this advertising session.
  • error Returns a PeripheralError if advertising cannot be initiated. In this case the handle will be closed.

Request

NameType
parameters AdvertisingParameters
handle request<AdvertisingHandle>

Response

NameType
result Peripheral_StartAdvertising_Result

OnPeerConnected

Event delivered when a remote LE central initiates a connection to this Peripheral when connectable advertising is enabled via Peripheral.StartAdvertising.

The returned Connection handle can be used to interact with the peer. It also represents a peripheral's ownership over the connection: the client can drop the handle to request a disconnection. Similarly, the handle is closed by the system to indicate that the connection to the peer has been lost.

  • request peer Information about the central that initiated the connection.
  • request handle Represents the connection.

Response

NameType
peer Peer
connection Connection

StartAdvertisingDeprecated

Request

NameType
advertising_data AdvertisingDataDeprecated
scan_result AdvertisingDataDeprecated?
connectable bool
interval_ms uint32
anonymous bool

Response

NameType
status fuchsia.bluetooth/Status
advertisement_id string?

StopAdvertisingDeprecated

Request

NameType
advertisement_id string

Response

NameType
status fuchsia.bluetooth/Status

OnCentralConnected

Response

NameType
advertisement_id string
central RemoteDevice

OnCentralDisconnected

Response

NameType
device_id string

STRUCTS

ServiceData

Defined in fuchsia.bluetooth.le/advertising_data.fidl

Entry in the service_data field of a AdvertisingData.

NameTypeDescriptionDefault
uuid fuchsia.bluetooth/Uuid No default
data vector<uint8> No default

ManufacturerData

Defined in fuchsia.bluetooth.le/advertising_data.fidl

Entry in the manufacturer_data field of a AdvertisingData.

NameTypeDescriptionDefault
company_id uint16 No default
data vector<uint8> No default

Peripheral_StartAdvertising_Response

generated

NameTypeDescriptionDefault

ServiceDataEntry

Defined in fuchsia.bluetooth.le/types_deprecated.fidl

NameTypeDescriptionDefault
uuid string No default
data vector<uint8> No default

ManufacturerSpecificDataEntry

Defined in fuchsia.bluetooth.le/types_deprecated.fidl

NameTypeDescriptionDefault
company_id uint16 No default
data vector<uint8> No default

AdvertisingDataDeprecated

Defined in fuchsia.bluetooth.le/types_deprecated.fidl

NameTypeDescriptionDefault
name string? No default
tx_power_level fuchsia.bluetooth/Int8? No default
appearance fuchsia.bluetooth/UInt16? No default
service_uuids vector<string>? No default
service_data vector<ServiceDataEntry>? No default
manufacturer_specific_data vector<ManufacturerSpecificDataEntry>? No default
solicited_service_uuids vector<string>? No default
uris vector<string>? No default

RemoteDevice

Defined in fuchsia.bluetooth.le/types_deprecated.fidl

NameTypeDescriptionDefault
identifier string No default
connectable bool No default
rssi fuchsia.bluetooth/Int8? No default
advertising_data AdvertisingDataDeprecated? No default

ScanFilter

Defined in fuchsia.bluetooth.le/types_deprecated.fidl

NameTypeDescriptionDefault
service_uuids vector<string>? No default
service_data_uuids vector<string>? No default
manufacturer_identifier fuchsia.bluetooth/UInt16? No default
connectable fuchsia.bluetooth/Bool? No default
name_substring string? No default
max_path_loss fuchsia.bluetooth/Int8? No default

ENUMS

PeripheralError

Type: uint32

Defined in fuchsia.bluetooth.le/peripheral.fidl

NameValueDescription
NOT_SUPPORTED 1
ADVERTISING_DATA_TOO_LONG 2
SCAN_RESPONSE_DATA_TOO_LONG 3
INVALID_PARAMETERS 4
FAILED 6

AdvertisingModeHint

Type: uint8

Defined in fuchsia.bluetooth.le/peripheral.fidl

A client can indicate the transmission rate of advertising packets by specifying a mode. The mode provides a hint to the system when configuring the controller with advertising interval and window parameters.

The mode affects how quickly a scanner or central is able to discover the peripheral; however it can have an adverse effect on power consumption. While the system will try to honor a client's request, it is not guaranteed to do so.

NameValueDescription
VERY_FAST 1
FAST 2
SLOW 3

TABLES

AdvertisingData

Defined in fuchsia.bluetooth.le/advertising_data.fidl

Represents advertising and scan response data that are transmitted by a LE peripheral or broadcaster.

OrdinalNameTypeDescription
1 name string Long or short name of the device.
2 appearance fuchsia.bluetooth/Appearance The appearance of the device.
3 tx_power_level int8 The radio transmit power level reported by an advertising peer. This field is disallowed when used with the Peripheral API.
4 service_uuids vector<fuchsia.bluetooth/Uuid> Service UUIDs.
5 service_data vector<ServiceData> Service data entries.
6 manufacturer_data vector<ManufacturerData> Manufacturer-specific data entries.
7 uris vector<string> String representing a URI to be advertised, as defined in [IETF STD 66](https://tools.ietf.org/html/std66). Each entry should be a UTF-8 string including the scheme. For more information, see: - https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml for allowed schemes; - https://www.bluetooth.com/specifications/assigned-numbers/uri-scheme-name-string-mapping for code-points used by the system to compress the scheme to save space in the payload.

Peer

Defined in fuchsia.bluetooth.le/peer.fidl

Represents a Bluetooth Low Energy peer that may act in the broadcaster, peripheral, or central role. The peer's role depends on whether it is obtained from the Central or Peripheral protocol.

OrdinalNameTypeDescription
1 id fuchsia.bluetooth/PeerId Uniquely identifies this peer on the current system. This field is always present.
2 connectable bool Whether or not this peer is connectable. Non-connectable peers are typically in the LE broadcaster role. This field is always present.
3 rssi int8 The last observed RSSI of this peer.
4 advertising_data AdvertisingData Advertising and scan response data broadcast by this peer. Present in broadcasters and peripherals.

AdvertisingParameters

Defined in fuchsia.bluetooth.le/peripheral.fidl

Represents the parameters for configuring advertisements.

OrdinalNameTypeDescription
1 data AdvertisingData The fields that will be encoded in the data section of advertising packets. This field is required.
2 scan_response AdvertisingData The fields that are to be sent in a scan response packet. Clients may use this to send additional data that does not fit inside an advertising packet on platforms that do not support the advertising data length extensions. If present advertisements will be configured to be scannable.
3 mode_hint AdvertisingModeHint The desired advertising frequency. See AdvertisingModeHint. Defaults to AdvertisingModeHint.SLOW if not present.
4 connectable bool If present and true then the controller will broadcast connectable advertisements which allows remote LE centrals to initiate a connection to the Peripheral. If false or otherwise not present then the advertisements will be non-connectable.

UNIONS

Peripheral_StartAdvertising_Result

generated

NameTypeDescription
response Peripheral_StartAdvertising_Response
err PeripheralError