MCPcopy Create free account
hub / github.com/deviceplug/btleplug / discover_services_with_timeout

Method discover_services_with_timeout

src/api/mod.rs:308–312  ·  view source on GitHub ↗

Like [`discover_services`](Peripheral::discover_services), but returns [`Error::TimedOut`](crate::Error::TimedOut) if discovery does not complete within the given duration.

(&self, timeout: Duration)

Source from the content-addressed store, hash-verified

306 /// [`Error::TimedOut`](crate::Error::TimedOut) if discovery does not complete within the
307 /// given duration.
308 async fn discover_services_with_timeout(&self, timeout: Duration) -> Result<()> {
309 tokio::time::timeout(timeout, self.discover_services())
310 .await
311 .map_err(|_| crate::Error::TimedOut(timeout))?
312 }
313
314 /// Write some data to the characteristic. Returns an error if the write couldn't be sent or (in
315 /// the case of a write-with-response) if the device returns an error.

Callers 1

find_and_connectFunction · 0.80

Calls 1

discover_servicesMethod · 0.45

Tested by

no test coverage detected