blob: ccc5f0cc4441f46feefaf244bf50a2165cc3c368 [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.control;
struct SecurityProperties {
bool authenticated;
bool secure_connections;
uint8 encryption_key_size;
};
// Represents a key that was received from a peer.
struct RemoteKey {
// The security properties of this link under which this key was received.
SecurityProperties security_properties;
// 128 bit key
array<uint8>:16 value;
};
// Represents a locally assigned key that is reused across bonds.
struct LocalKey {
array<uint8>:16 value;
};
// Represents a LE Long-Term RemoteKey. The `ediv` and `rand` fields are zero if
// distributed using LE Secure Connections pairing.
struct LTK {
RemoteKey key;
uint8 key_size;
uint16 ediv;
uint64 rand;
};
// The preferred LE connection parameters of the peer.
struct LEConnectionParameters {
uint16 connection_interval;
uint16 connection_latency;
uint16 supervision_timeout;
};
enum AddressType : uint8 {
LE_PUBLIC = 0;
LE_RANDOM = 1;
BREDR = 2;
};
struct LEData {
// The identity address of the peer. If `resolvable` is true, then this is the
// resolved private address (and the `irk` is present).
string address;
AddressType address_type;
// The peer’s preferred connection parameters, if known.
LEConnectionParameters? connection_parameters;
// Known GATT service UUIDs.
vector<string:36> services;
// The LE long-term key. Present if the link was encrypted.
LTK? ltk;
// Identity Resolving RemoteKey used to generate and resolve random addresses.
RemoteKey? irk;
// Connection Signature Resolving RemoteKey used for data signing without encryption.
RemoteKey? csrk;
};
struct BREDRData {
// The public device address of the peer.
string address;
// True if the peer prefers to lead the piconet. This is determined by role
// switch procedures. Paging and connecting from a peer does not automatically
// set this flag.
bool piconet_leader;
// Known SDP service UUIDs.
vector<string:36> services;
// The semi-permanent BR/EDR key. Present if link was paired with Secure
// Simple Pairing or stronger.
LTK? link_key;
};
// Represents the bonding data for a single peer.
struct BondingData {
// The identifier that uniquely identifies this device.
string identifier;
// The local Bluetooth identity address that this bond is associated with.
string local_address;
// The name of the device, if any.
string? name;
// Bonding data that is present when this device is paired on the LE transport.
LEData? le;
// Bonding data that is present when this device is paired on the BR/EDR transport.
BREDRData? bredr;
};
/// Represents persistent local host data.
// TODO(BT-813): Consider using a table instead of struct.
struct HostData {
/// The local Identity Resolving Key used by a bt-host device to generate Resolvable Private
/// Addresses when privacy is enabled.
///
/// NOTE: This key is distributed to LE peers during pairing procedures. The client must take
/// care to assign an IRK that consistent with the local bt-host identity.
// TODO(BT-815): Document behavior once there is a better privacy policy when `irk` is null.
LocalKey? irk;
};