blob: 2dc1acfd78556ba57f391b5e77a30b686abb36d7 [file] [log] [blame]
// Copyright 2019 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.sys;
using fuchsia.bluetooth as bt;
using zx;
/// Information about a Bluetooth controller and its associated host-subsystem state.
type HostInfo = table {
/// Uniquely identifies a host on the current system.
///
/// This field is always present.
1: id bt.HostId;
/// The Bluetooth technologies that are supported by this adapter.
///
/// This field is always present.
2: technology TechnologyType;
/// The identity address.
///
/// This field is always present.
3: address bt.Address;
/// Indicates whether or not this is the active host. The system has one active host which
/// handles all Bluetooth procedures.
4: active bool;
/// The local name of this host. This is the name that is visible to other devices when this
/// host is in the discoverable mode.
5: local_name bt.DeviceName;
/// Whether or not the local adapter is currently discoverable over BR/EDR and
/// LE physical channels.
6: discoverable bool;
/// Whether or not device discovery is currently being performed.
7: discovering bool;
};
/// Protocol used to observe and manage the Bluetooth controllers on the system.
@discoverable
protocol HostWatcher {
/// Obtain a list of all available Bluetooth controllers and their state. A response is sent
/// only if this list has changed since the last time the client has sent this message.
Watch() -> (struct {
hosts vector<HostInfo>:MAX;
});
/// Designates the host with the given `id` as active. All Bluetooth procedures will be routed
/// over this host. Any previously assigned active host will be disabled and all of its pending
/// procedures will be terminated.
///
/// * error This can fail if a host with `id` was not found.
SetActive(struct {
id bt.HostId;
}) -> (struct {}) error zx.status;
};