blob: 58828f4498a72477328808c3ca82e8f2be4a15ea [file] [log] [blame]
// Copyright 2023 Google LLC
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/// Peers are identified by ids, which should be treated as opaque by service libraries.
/// Stack implementations should ensure that each PeerId identifies a single peer over a single
/// instance of the stack - a [`bt_gatt::Central::connect`] should always attempt to connect to the
/// same peer as long as the PeerId was retrieved after the `Central` was instantiated.
/// PeerIds can be valid longer than that (often if the peer is bonded)
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct PeerId(pub u64);
impl core::fmt::Display for PeerId {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
write!(f, "{:x}", self.0)
}
}
pub mod uuid;
pub use crate::uuid::Uuid;