diff options
| author | Gustav Toft <[email protected]> | 2024-06-05 08:14:35 +0200 |
|---|---|---|
| committer | Gustav Toft <[email protected]> | 2024-06-05 08:14:35 +0200 |
| commit | a516dbd5e27e73d4e2c245d8903c57d97186cbaa (patch) | |
| tree | 12b469271871628eec98c9efa572c245c64570d0 | |
| parent | 319e18b3997756942803cb1c10ae43327a4e3056 (diff) | |
CYW43: Add function to close existing soft AP
| -rw-r--r-- | cyw43/src/control.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/cyw43/src/control.rs b/cyw43/src/control.rs index cd890c982..0a8cb9c8c 100644 --- a/cyw43/src/control.rs +++ b/cyw43/src/control.rs | |||
| @@ -393,6 +393,23 @@ impl<'a> Control<'a> { | |||
| 393 | self.set_iovar_u32x2("bss", 0, 1).await; // bss = BSS_UP | 393 | self.set_iovar_u32x2("bss", 0, 1).await; // bss = BSS_UP |
| 394 | } | 394 | } |
| 395 | 395 | ||
| 396 | pub async fn close_ap(&mut self) { | ||
| 397 | // Stop AP | ||
| 398 | self.set_iovar_u32x2("bss", 0, 0).await; // bss = BSS_DOWN | ||
| 399 | |||
| 400 | // Turn off AP mode | ||
| 401 | self.ioctl_set_u32(IOCTL_CMD_SET_AP, 0, 0).await; | ||
| 402 | |||
| 403 | // Temporarily set wifi down | ||
| 404 | self.down().await; | ||
| 405 | |||
| 406 | // Turn on APSTA mode | ||
| 407 | self.set_iovar_u32("apsta", 1).await; | ||
| 408 | |||
| 409 | // Set wifi up again | ||
| 410 | self.up().await; | ||
| 411 | } | ||
| 412 | |||
| 396 | /// Add specified address to the list of hardware addresses the device | 413 | /// Add specified address to the list of hardware addresses the device |
| 397 | /// listens on. The address must be a Group address (I/G bit set). Up | 414 | /// listens on. The address must be a Group address (I/G bit set). Up |
| 398 | /// to 10 addresses are supported by the firmware. Returns the number of | 415 | /// to 10 addresses are supported by the firmware. Returns the number of |
