pub struct AsyncBle<'a> { /* private fields */ }Expand description
Handle for the box’s BLE adapter (from crate::LagerBox::ble).
Implementations§
Source§impl<'a> AsyncBle<'a>
impl<'a> AsyncBle<'a>
Sourcepub async fn scan(&self, timeout: f64) -> Result<Vec<BleDevice>>
pub async fn scan(&self, timeout: f64) -> Result<Vec<BleDevice>>
Scan for advertising devices for timeout seconds
(0.1–300, sorted named-first).
Sourcepub async fn scan_named(
&self,
timeout: f64,
name_contains: &str,
) -> Result<Vec<BleDevice>>
pub async fn scan_named( &self, timeout: f64, name_contains: &str, ) -> Result<Vec<BleDevice>>
Scan, keeping only devices whose name contains name_contains
(case-insensitive).
Sourcepub async fn info(&self, address: &str) -> Result<BleDeviceInfo>
pub async fn info(&self, address: &str) -> Result<BleDeviceInfo>
Connect briefly and enumerate the device’s GATT services.
Sourcepub async fn connect(&self, address: &str) -> Result<BleDeviceInfo>
pub async fn connect(&self, address: &str) -> Result<BleDeviceInfo>
Connect to a device (and enumerate its services to verify).
Sourcepub async fn disconnect(&self, address: &str) -> Result<()>
pub async fn disconnect(&self, address: &str) -> Result<()>
Ensure a device is disconnected from the box.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for AsyncBle<'a>
impl<'a> !UnwindSafe for AsyncBle<'a>
impl<'a> Freeze for AsyncBle<'a>
impl<'a> Send for AsyncBle<'a>
impl<'a> Sync for AsyncBle<'a>
impl<'a> Unpin for AsyncBle<'a>
impl<'a> UnsafeUnpin for AsyncBle<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more