aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/control.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/control.rs b/src/control.rs
index bcb449375..934bade23 100644
--- a/src/control.rs
+++ b/src/control.rs
@@ -309,6 +309,13 @@ impl<'a> Control<'a> {
309 resp_len 309 resp_len
310 } 310 }
311 311
312 /// Start a wifi scan
313 ///
314 /// Returns a `Stream` of networks found by the device
315 ///
316 /// # Note
317 /// Device events are currently implemented using a bounded queue.
318 /// To not miss any events, you should make sure to always await the stream.
312 pub async fn scan(&mut self) -> Scanner<'_> { 319 pub async fn scan(&mut self) -> Scanner<'_> {
313 const SCANTYPE_PASSIVE: u8 = 1; 320 const SCANTYPE_PASSIVE: u8 = 1;
314 321
@@ -346,6 +353,7 @@ pub struct Scanner<'a> {
346} 353}
347 354
348impl Scanner<'_> { 355impl Scanner<'_> {
356 /// wait for the next found network
349 pub async fn next(&mut self) -> Option<BssInfo> { 357 pub async fn next(&mut self) -> Option<BssInfo> {
350 let event = self.subscriber.next_message_pure().await; 358 let event = self.subscriber.next_message_pure().await;
351 if event.header.status != EStatus::PARTIAL { 359 if event.header.status != EStatus::PARTIAL {