aboutsummaryrefslogtreecommitdiff
path: root/src/runner.rs
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2023-04-30 15:05:16 +0000
committerGitHub <[email protected]>2023-04-30 15:05:16 +0000
commit5659269c8fb2f7d03d4a903e4ad48c8268668f0a (patch)
treee35e59f37d50791029c2f88b3014b409ea802d39 /src/runner.rs
parentc19de2984751ba6fa2972ee66cfa2a6310d5f0c1 (diff)
parent76b967a966677e570cc0a2942ed3ccd29b2d1017 (diff)
Merge pull request #70 from kbleeke/wifi-scanning-ioctl
Wifi scanning ioctl
Diffstat (limited to 'src/runner.rs')
-rw-r--r--src/runner.rs14
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;
7use crate::bus::Bus; 7use crate::bus::Bus;
8pub use crate::bus::SpiBusCyw43; 8pub use crate::bus::SpiBusCyw43;
9use crate::consts::*; 9use crate::consts::*;
10use crate::events::{Events, Status}; 10use crate::events::{Event, Events, Status};
11use crate::fmt::Bytes; 11use crate::fmt::Bytes;
12use crate::ioctl::{IoctlState, IoctlType, PendingIoctl}; 12use crate::ioctl::{IoctlState, IoctlType, PendingIoctl};
13use crate::nvram::NVRAM; 13use 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