diff options
| author | kbleeke <[email protected]> | 2023-04-28 21:17:13 +0200 |
|---|---|---|
| committer | kbleeke <[email protected]> | 2023-04-28 21:28:59 +0200 |
| commit | 76b967a966677e570cc0a2942ed3ccd29b2d1017 (patch) | |
| tree | e35e59f37d50791029c2f88b3014b409ea802d39 | |
| parent | 2c5d94493c25792435102680fe8e659cc7dad9df (diff) | |
comment wifi scanning items
| -rw-r--r-- | src/control.rs | 8 |
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 | ||
| 348 | impl Scanner<'_> { | 355 | impl 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 { |
