aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrostie314159 <[email protected]>2023-08-28 21:34:14 +0200
committerFrostie314159 <[email protected]>2023-08-28 21:34:14 +0200
commite0256939141ab8e4670f58e87886d0266c1d462c (patch)
treef2cf1c8e15f0b6eb39859e99fff3cdc4de74421f
parent05ee02b5933dc8e87f3714294d272aa4cb23aefb (diff)
cyw43: Create leave function on Control struct.
Create a function, which disassociates us, from the currently connected infra.
-rw-r--r--cyw43/src/consts.rs1
-rw-r--r--cyw43/src/control.rs5
2 files changed, 6 insertions, 0 deletions
diff --git a/cyw43/src/consts.rs b/cyw43/src/consts.rs
index 1f6551589..4e2836f3b 100644
--- a/cyw43/src/consts.rs
+++ b/cyw43/src/consts.rs
@@ -96,6 +96,7 @@ pub(crate) const IOCTL_CMD_UP: u32 = 2;
96pub(crate) const IOCTL_CMD_DOWN: u32 = 3; 96pub(crate) const IOCTL_CMD_DOWN: u32 = 3;
97pub(crate) const IOCTL_CMD_SET_SSID: u32 = 26; 97pub(crate) const IOCTL_CMD_SET_SSID: u32 = 26;
98pub(crate) const IOCTL_CMD_SET_CHANNEL: u32 = 30; 98pub(crate) const IOCTL_CMD_SET_CHANNEL: u32 = 30;
99pub(crate) const IOCTL_CMD_DISASSOC: u32 = 52;
99pub(crate) const IOCTL_CMD_ANTDIV: u32 = 64; 100pub(crate) const IOCTL_CMD_ANTDIV: u32 = 64;
100pub(crate) const IOCTL_CMD_SET_AP: u32 = 118; 101pub(crate) const IOCTL_CMD_SET_AP: u32 = 118;
101pub(crate) const IOCTL_CMD_SET_VAR: u32 = 263; 102pub(crate) const IOCTL_CMD_SET_VAR: u32 = 263;
diff --git a/cyw43/src/control.rs b/cyw43/src/control.rs
index d2f6e4a03..a6d1f0bf5 100644
--- a/cyw43/src/control.rs
+++ b/cyw43/src/control.rs
@@ -433,6 +433,11 @@ impl<'a> Control<'a> {
433 events: &self.events, 433 events: &self.events,
434 } 434 }
435 } 435 }
436 /// Leave the wifi, with which we are currently associated.
437 pub async fn leave(&mut self) {
438 self.ioctl(IoctlType::Set, IOCTL_CMD_DISASSOC, 0, &mut []).await;
439 info!("Disassociated")
440 }
436} 441}
437 442
438pub struct Scanner<'a> { 443pub struct Scanner<'a> {