class Central
Defined at line 16711 of file fidling/gen/sdk/fidl/fuchsia.bluetooth.le/fuchsia.bluetooth.le/hlcpp/fuchsia/bluetooth/le/cpp/fidl.h
Public Members
static const char[] Name_
Public Methods
void ~Central ()
void ListenL2cap (::fuchsia::bluetooth::le::ChannelListenerRegistryListenL2capRequest ChannelListenerRegistryListenL2capRequest, ListenL2capCallback callback)
Register a listener for incoming channels. The registry will assign a
PSM value that is unique for the local device, as well as open a
[`ChannelListener`] for accepting incoming channels. In the unlikely
event that all PSMs have been assigned, this call will fail with
`ZX_ERR_NO_RESOURCES`.
Note that the method of service discovery or advertising is defined by
the service or protocol, so it is the responsibility of the caller to
communicate the assigned PSM to any clients.
void Scan (::fuchsia::bluetooth::le::ScanOptions options, ::fidl::InterfaceRequest< ::fuchsia::bluetooth::le::ScanResultWatcher> result_watcher, ScanCallback callback)
Scans for nearby LE peripherals and broadcasters. If the scan cannot be
initiated, then `result_watcher` will be closed with an epitaph.
A Central client is allowed to have only one active scan at a time.
Accordingly, only one Scan request can be outstanding at a time.
Additional calls to Scan will fail.
The lifetime of the scan session is tied to the `result_watcher`
protocol provided. The scan will be stopped if the channel is closed.
Once a scan is started, the [`fuchsia.bluetooth.le/ScanResultWatcher`]
can be used to watch for scan results.
+ request `options` Options used to configure the scan session.
+ request `result_watcher` Protocol that remains valid for the duration
of this scan session.
- response An empty response will be sent to acknowledge the scan has
stopped.
The following epitaphs may be sent by the server on error:
* error `ALREADY_EXISTS`: A scan is already in progress. Each `Central`
protocol is only allowed 1 active scan.
* error `INVALID_ARGS`: Some of the scan `options` are invalid. See the
`ScanOptions` documentation.
* error `INTERNAL`: An internal error occurred and a scan could not be
started.
void Connect (::fuchsia::bluetooth::PeerId id, ::fuchsia::bluetooth::le::ConnectionOptions options, ::fidl::InterfaceRequest< ::fuchsia::bluetooth::le::Connection> handle)
Connect to the peer with the given identifier.
The requested [`fuchsia.bluetooth.le/Connection`] represents the
client's interest on the LE connection to the peer. Closing the channel
removes interest, but may not result in disconnection if another client
holds a valid [`fuchsia.bluetooth.le/Connection`] to the same peer.
The [`fuchsia.bluetooth.le/Connection`] `handle` will be closed by the
system if the connection to the peer is lost or an error occurs.
The following epitaphs may be sent by the server on error:
+ `INVALID_ARGS`: Some of the parameters are invalid.
+ `ALREADY_BOUND`: A Connection to the peer already exists for this Central. The existing
Connection should be used.
+ `NOT_CONNECTED`: A connection could not be established.
+ `CONNECTION_RESET`: The peer disconnected.
+ request `id` Identifier of the peer to initiate a connection to.
+ request `options` Options used to configure the connection.
+ request `handle` Handle that remains valid for the duration of this
connection.
void SyncToPeriodicAdvertising (::fuchsia::bluetooth::le::CentralSyncToPeriodicAdvertisingRequest CentralSyncToPeriodicAdvertisingRequest)
Synchronize to a periodic advertising train. Reports will be delivered via the
`PeriodicAdvertisingSync` protocol.
void CreateConnectedIsochronousGroup (::fuchsia::bluetooth::le::CentralCreateConnectedIsochronousGroupRequest CentralCreateConnectedIsochronousGroupRequest, CreateConnectedIsochronousGroupCallback callback)
Create a new Connected Iosochronous Group (CIG) with the specified parameters. This
operation is only valid when operating in the Central role for a connection.
If the Central channel is closed before the CIG is explicitly removed, the group will
be removed and disconnected.
On failure, returns an error code, see `CreateCigError`. On success, returns a unique
id allocated by the host.
void GetPeripherals (::fidl::VectorPtr< ::std::string> service_uuids, GetPeripheralsCallback callback)
Returns the list of peripherals that are known to the system from previous scan, connection,
and/or bonding procedures. The results can be filtered based on service UUIDs that are known to
be present on the peripheral.
This method only returns peripherals (i.e. connectable devices).
void GetPeripheral (::std::string identifier, GetPeripheralCallback callback)
**This method is not implemented by the Fuchsia core stack- TODO(https://fxbug.dev/42087303)**
Returns information about a single peripheral that is known to the system from previous scan,
connection, and/or bonding procedures based on its unique identifier. Returns null if
`identifier` is not recognized.
void StartScan (::std::unique_ptr< ::fuchsia::bluetooth::le::ScanFilter> filter, StartScanCallback callback)
Initiates a scan session for nearby peripherals and broadcasters. Discovered devices will be
reported via CentralDelegate.OnDeviceDiscovered(). If a scan session is already in progress,
`filter` will replace the existing session's filter.
If `filter` is null or empty (i.e. none of its fields has been populated) then the delegate
will be notified for all discoverable devices that are found. This is not recommended; clients
should generally filter results by at least one of `filter.service_uuids`,
`filter.service_data`, and/or `filter.manufacturer_identifier`.
void StopScan ()
Terminate a previously started scan session.
void ConnectPeripheral (::std::string identifier, ::fuchsia::bluetooth::le::ConnectionOptions options, ::fidl::InterfaceRequest< ::fuchsia::bluetooth::gatt::Client> gatt_client, ConnectPeripheralCallback callback)
Creates a connection to the peripheral device with the given identifier.
Returns the status of the operation in `status`.
On success, `gatt_client` will be bound and can be used for GATT client
role procedures. On failure, `gatt_client` will be closed and `status` will
indicate an error.
void DisconnectPeripheral (::std::string identifier, DisconnectPeripheralCallback callback)
Disconnects this Central's connection to the peripheral with the given identifier.