From 76b967a966677e570cc0a2942ed3ccd29b2d1017 Mon Sep 17 00:00:00 2001 From: kbleeke Date: Fri, 28 Apr 2023 21:17:13 +0200 Subject: [PATCH] comment wifi scanning items --- src/control.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/control.rs b/src/control.rs index bcb44937..934bade2 100644 --- a/src/control.rs +++ b/src/control.rs @@ -309,6 +309,13 @@ impl<'a> Control<'a> { resp_len } + /// Start a wifi scan + /// + /// Returns a `Stream` of networks found by the device + /// + /// # Note + /// Device events are currently implemented using a bounded queue. + /// To not miss any events, you should make sure to always await the stream. pub async fn scan(&mut self) -> Scanner<'_> { const SCANTYPE_PASSIVE: u8 = 1; @@ -346,6 +353,7 @@ pub struct Scanner<'a> { } impl Scanner<'_> { + /// wait for the next found network pub async fn next(&mut self) -> Option { let event = self.subscriber.next_message_pure().await; if event.header.status != EStatus::PARTIAL {