blob: eead0fa31532b30628767174ed46f6959e584ce9 [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;
type TechnologyType = strict enum {
LOW_ENERGY = 1;
CLASSIC = 2;
DUAL_MODE = 3;
};
/// Maximum number of discovered services for each transport. Currently set to the number of valid
/// 16-bit handles or PSMs used to access services.
const MAX_PEER_SERVICES uint16 = 65535;
/// Represents a remote BR/EDR, LE, or dual-mode BR/EDR/LE peer.
type Peer = table {
/// Uniquely identifies this peer on the current system.
///
/// This field is always present.
1: id bt.PeerId;
/// Bluetooth device address that identifies this peer. Clients
/// should display this field to the user when `name` is not available.
///
/// This field is always present.
///
/// NOTE: Clients should use the `identifier` field to keep track of peers instead of their
/// address.
2: address bt.Address;
/// The Bluetooth technologies that are supported by this peer.
///
/// This field is always present.
3: technology TechnologyType;
/// Whether or not a BR/EDR and/or LE connection exists to this peer.
///
/// This field is always present.
4: connected bool;
/// Whether or not this peer is bonded.
///
/// This field is always present.
5: bonded bool;
/// The name of the peer, if known.
6: name bt.DeviceName;
/// The LE appearance property. Present if this peer supports LE and the
/// appearance information was obtained over advertising and/or GATT.
7: appearance bt.Appearance;
/// The class of device for this device, if known.
8: device_class bt.DeviceClass;
/// The most recently obtained advertising signal strength for this peer. Present if known.
9: rssi int8;
/// The most recently obtained transmission power for this peer. Present if known.
10: tx_power int8;
/// The list of service UUIDs known to be available on this peer.
///
/// This is a legacy field that should not be depended on for new code.
@deprecated
11: services vector<bt.Uuid>:MAX_PEER_SERVICES;
/// The list of service UUIDs known to be available on the LE transport.
///
/// Never present if technology is CLASSIC.
12: le_services vector<bt.Uuid>:MAX_PEER_SERVICES;
/// The cached list of service UUIDs previously discovered on the BR/EDR transport.
/// Services are not removed if peer is disconnected if subsequent searches don't find them.
///
/// Never present if technology is LOW_ENERGY.
///
/// This is a legacy field that should not be depended on for new code.
@deprecated
13: bredr_services vector<bt.Uuid>:MAX_PEER_SERVICES;
};