pub struct BluestConnection { /* private fields */ }Expand description
A GattConnection over a connected bluest Device that reconnects and
retries on a dropped link.
Implementations§
Source§impl BluestConnection
impl BluestConnection
Sourcepub async fn new(adapter: Adapter, device: Device) -> Result<Self>
pub async fn new(adapter: Adapter, device: Device) -> Result<Self>
Wrap an already-connected device, discovering its services and characteristics.
§Errors
Returns BleError::Backend on a bluest discovery failure.
Sourcepub async fn disconnect(&self)
pub async fn disconnect(&self)
Release the active GATT link. A sleepy HAP accessory only advertises and emits encrypted broadcasts while disconnected, and on macOS CoreBluetooth filters a connected peripheral out of scan results — so a caller watching for sleepy events must disconnect after setup. A subsequent encrypted operation (e.g. a disconnected-event poll read) transparently reconnects via the supervisor.
Trait Implementations§
Source§impl AdvertSource for BluestConnection
impl AdvertSource for BluestConnection
Source§fn watch_adverts<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Receiver<RawAdvert>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn watch_adverts<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Receiver<RawAdvert>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stream Apple HAP advertisements by running a continuous adapter scan.
Spawns a background task that feeds every Apple (company id 0x004C)
manufacturer-data frame into the returned channel. The task stops when
the receiver is dropped or the adapter’s scan stream ends.
§Errors
Returns crate::error::BleError on adapter/scan failures.