1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#![doc = include_str!("../README.md")]
#![cfg_attr(test, allow(unused_crate_dependencies))]
pub use profile::*;
#[path = "att/att.rs"]
pub mod att;
#[path = "gap/gap.rs"]
pub mod gap;
#[path = "gatt/gatt.rs"]
pub mod gatt;
#[path = "hci/hci.rs"]
pub mod hci;
#[path = "host/host.rs"]
pub mod host;
#[path = "l2cap/l2cap.rs"]
pub mod l2cap;
pub mod le;
#[path = "smp/smp.rs"]
pub mod smp;
pub mod sdp {
pub use burble_const::ServiceClass;
}
mod profile {
pub mod bas;
pub mod dis;
#[path = "hid/hid.rs"]
pub mod hid;
pub mod hogp;
}
type SyncMutex<T> = parking_lot::Mutex<T>;
type SyncMutexGuard<'a, T> = parking_lot::MutexGuard<'a, T>;
type AsyncMutex<T> = tokio::sync::Mutex<T>;
type AsyncRwLock<T> = tokio::sync::RwLock<T>;
pub trait PeerStore: std::fmt::Debug + Send + Sync {
type Value;
fn save(&self, peer: le::Addr, v: &Self::Value) -> bool;
#[must_use]
fn load(&self, peer: le::Addr) -> Option<Self::Value>;
fn remove(&self, peer: le::Addr);
fn clear(&self);
}
macro_rules! impl_display_via_debug {
($($t:ty),*$(,)?) => {$(
impl ::core::fmt::Display for $t {
#[inline(always)]
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
::core::fmt::Debug::fmt(self, f)
}
}
)*};
}
pub(crate) use impl_display_via_debug;
macro_rules! name_of {
($t:ty) => {{
type _T = $t; stringify!($t)
}};
}
pub(crate) use name_of;