pub struct BluestConnection { /* private fields */ }Expand description
A GattConnection over a connected bluest Device that reconnects and
retries on a dropped link.
Implementations§
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. Forwarding is
best-effort: frames are dropped when the receiver falls behind, not
queued unboundedly, to ensure the task never blocks on backpressure
and can always respond to a pause request. While a connect owns the
radio (the [ScanGate] is paused) the task drops its scan stream and
restarts it on resume. The task stops for good when the receiver is
dropped or the adapter’s scan stream ends.
Intended for a single active watcher per connection: concurrent scan tasks would share one scanning flag and corrupt the pause-ack protocol.
§Errors
Returns crate::error::BleError on adapter/scan failures.