pub struct ConnectedPeripheral { /* private fields */ }Expand description
A connected lighthouse device ready for GATT operations.
Implementations§
Source§impl ConnectedPeripheral
impl ConnectedPeripheral
Sourcepub async fn power_on(&self, lh: &Lighthouse) -> Result<()>
pub async fn power_on(&self, lh: &Lighthouse) -> Result<()>
Power on the connected lighthouse.
§Errors
Returns an error if the power command cannot be built (e.g. missing V1 ID) or if writing to the GATT characteristic fails after retries.
Sourcepub async fn sleep(&self, lh: &Lighthouse) -> Result<()>
pub async fn sleep(&self, lh: &Lighthouse) -> Result<()>
Sleep the connected lighthouse.
§Errors
Returns an error if the sleep command cannot be built (e.g. missing V1 ID) or if writing to the GATT characteristic fails after retries.
Sourcepub async fn identify(&self, lh: &Lighthouse) -> Result<()>
pub async fn identify(&self, lh: &Lighthouse) -> Result<()>
Identify the connected lighthouse (V2 only — causes LED flash).
§Errors
Returns an error if the lighthouse is not V2, or if writing to the identify characteristic fails after retries.
Sourcepub async fn disconnect(self)
pub async fn disconnect(self)
Disconnect the device.
Auto Trait Implementations§
impl Freeze for ConnectedPeripheral
impl !RefUnwindSafe for ConnectedPeripheral
impl Send for ConnectedPeripheral
impl Sync for ConnectedPeripheral
impl Unpin for ConnectedPeripheral
impl UnsafeUnpin for ConnectedPeripheral
impl !UnwindSafe for ConnectedPeripheral
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