apple_ble/
session.rs

1
2/// Wrapper around the bluer [session](bluer::Session) and [adapter](bluer::Adapter)
3pub struct Session {
4    pub session: bluer::Session,
5    pub adapter: bluer::Adapter,
6    pub mac_changed: bool
7}
8impl Session {
9    /// Creates a new [Session](crate::Session)
10    pub async fn new() -> bluer::Result<Self> {
11        let session = bluer::Session::new().await?;
12        let adapter = session.default_adapter().await?;
13        Ok(Session { session, adapter, mac_changed: false })
14    }
15}