diff options
| author | kbleeke <[email protected]> | 2023-03-30 17:05:29 +0200 |
|---|---|---|
| committer | kbleeke <[email protected]> | 2023-04-28 21:28:59 +0200 |
| commit | 2c5d94493c25792435102680fe8e659cc7dad9df (patch) | |
| tree | bac666dbe8b406d0c1f249de6a8f3c7dc4b94731 /src/runner.rs | |
| parent | c19de2984751ba6fa2972ee66cfa2a6310d5f0c1 (diff) | |
wifi scan ioctl
Diffstat (limited to 'src/runner.rs')
| -rw-r--r-- | src/runner.rs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/runner.rs b/src/runner.rs index 806ddfc49..9b99e174f 100644 --- a/src/runner.rs +++ b/src/runner.rs | |||
| @@ -7,7 +7,7 @@ use embedded_hal_1::digital::OutputPin; | |||
| 7 | use crate::bus::Bus; | 7 | use crate::bus::Bus; |
| 8 | pub use crate::bus::SpiBusCyw43; | 8 | pub use crate::bus::SpiBusCyw43; |
| 9 | use crate::consts::*; | 9 | use crate::consts::*; |
| 10 | use crate::events::{Events, Status}; | 10 | use crate::events::{Event, Events, Status}; |
| 11 | use crate::fmt::Bytes; | 11 | use crate::fmt::Bytes; |
| 12 | use crate::ioctl::{IoctlState, IoctlType, PendingIoctl}; | 12 | use crate::ioctl::{IoctlState, IoctlType, PendingIoctl}; |
| 13 | use crate::nvram::NVRAM; | 13 | use crate::nvram::NVRAM; |
| @@ -351,6 +351,8 @@ where | |||
| 351 | panic!("IOCTL error {}", cdc_header.status as i32); | 351 | panic!("IOCTL error {}", cdc_header.status as i32); |
| 352 | } | 352 | } |
| 353 | 353 | ||
| 354 | info!("IOCTL Response: {:02x}", Bytes(response)); | ||
| 355 | |||
| 354 | self.ioctl_state.ioctl_done(response); | 356 | self.ioctl_state.ioctl_done(response); |
| 355 | } | 357 | } |
| 356 | } | 358 | } |
| @@ -404,7 +406,15 @@ where | |||
| 404 | 406 | ||
| 405 | if self.events.mask.is_enabled(evt_type) { | 407 | if self.events.mask.is_enabled(evt_type) { |
| 406 | let status = event_packet.msg.status; | 408 | let status = event_packet.msg.status; |
| 407 | let event_payload = events::Payload::None; | 409 | let event_payload = match evt_type { |
| 410 | Event::ESCAN_RESULT if status == EStatus::PARTIAL => { | ||
| 411 | let Some((_, bss_info)) = ScanResults::parse(evt_data) else { return }; | ||
| 412 | let Some(bss_info) = BssInfo::parse(bss_info) else { return }; | ||
| 413 | events::Payload::BssInfo(*bss_info) | ||
| 414 | } | ||
| 415 | Event::ESCAN_RESULT => events::Payload::None, | ||
| 416 | _ => events::Payload::None, | ||
| 417 | }; | ||
| 408 | 418 | ||
| 409 | // this intentionally uses the non-blocking publish immediate | 419 | // this intentionally uses the non-blocking publish immediate |
| 410 | // publish() is a deadlock risk in the current design as awaiting here prevents ioctls | 420 | // publish() is a deadlock risk in the current design as awaiting here prevents ioctls |
