blob: bcf701a38e6695d84ec28fa670958f0e5a62282c [file] [log] [blame]
// Copyright 2018 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
library fuchsia.bluetooth.host;
using fuchsia.bluetooth;
using fuchsia.bluetooth.control;
using fuchsia.bluetooth.gatt;
using fuchsia.bluetooth.le;
using fuchsia.bluetooth.bredr;
// Interface for interacting with a Bluetooth host device (bt-host)
interface Host {
// The following methods fulfill a given interface request. bt-host device
// will start processing FIDL messages. If the request cannot be fulfilled,
// the bt-host device will close its end of the given channel.
1: RequestLowEnergyCentral(request<fuchsia.bluetooth.le.Central> central);
2: RequestLowEnergyPeripheral(request<fuchsia.bluetooth.le.Peripheral> peripheral);
3: RequestGattServer(request<fuchsia.bluetooth.gatt.Server> server);
4: RequestProfile(request<fuchsia.bluetooth.bredr.Profile> profile);
// Closes all FIDL interface handles that are associated with this bt-host
// device (excluding any Host interface handles).
5: Close();
// Returns information about the Bluetooth adapter managed by this host.
6: GetInfo() -> (fuchsia.bluetooth.control.AdapterInfo @info);
// Sets the local name for this adapter.
7: SetLocalName(string local_name) -> (fuchsia.bluetooth.Status status);
// Initiates a general discovery procedure for BR/EDR and LE devices. On success, discovered
// devices will be reported via AdapterDelegate.OnDeviceDiscovered().
//
// On the LE transport, only general-discoverable and connectable peripherals will be reported.
//
// Discovery will continue until it is terminated via StopDiscovery() or if the proxy to the
// Adapter gets disconnected.
8: StartDiscovery() -> (fuchsia.bluetooth.Status status);
// Terminates discovery if one was started via StartDiscovery(). The AdapterDelegate will stop
// receiving device discovery notifications.
//
// NOTE: If another client is performing discovery (e.g. via its own Adapter interface handle),
// then the system will continue performing device discovery even if this method results in
// success.
9: StopDiscovery() -> (fuchsia.bluetooth.Status status);
// Sets whether this host should be connectable.
10: SetConnectable(bool enabled) -> (fuchsia.bluetooth.Status status);
// Sets whether this host should be discoverable.
11: SetDiscoverable(bool enabled) -> (fuchsia.bluetooth.Status status);
// Assigns the pairing delegate that will respond to authentication challenges using the given
// I/O capabilities. Setting a pairing delegate cancels any on-going pairing procedure started
// using a previous delegate. Pairing requests will be rejected if no PairingDelegate has been
// assigned.
12: SetPairingDelegate(
fuchsia.bluetooth.control.InputCapabilityType input,
fuchsia.bluetooth.control.OutputCapabilityType output,
fuchsia.bluetooth.control.PairingDelegate? delegate);
// TODO(NET-1148): add Forget() & -> OnDeleteBond
// Adds existing bonded devices to the host. The host will be configured to automatically connect
// to these devices when they are in range and connectable. Future connections will be encrypted
// using the provided bonding data.
110: AddBondedDevices(vector<fuchsia.bluetooth.control.BondingData> bonds) -> (fuchsia.bluetooth.Status status);
// Events
101: -> OnAdapterStateChanged(fuchsia.bluetooth.control.AdapterState state);
102: -> OnDeviceUpdated(fuchsia.bluetooth.control.RemoteDevice device);
103: -> OnDeviceRemoved(string identifier);
104: -> OnNewBondingData(fuchsia.bluetooth.control.BondingData data);
};