diff options
| author | Dario Nieuwenhuis <[email protected]> | 2024-06-05 12:06:30 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-06-05 12:06:30 +0000 |
| commit | 5af0fe8a5860899a4c22fed39ad75b816affbc80 (patch) | |
| tree | 153426bb7c61d91fd7e7c1fbb8fe795ffa1f6662 | |
| parent | 5f9bc6def7ea8698a6ce45d8e12e1d1bd8cce876 (diff) | |
| parent | 36107996185fdb7b4db2b2f2bc927033cf6d4e41 (diff) | |
Merge pull request #3042 from GustavToft/fix_main
Adding function to close soft AP.
| -rw-r--r-- | cyw43/src/control.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/cyw43/src/control.rs b/cyw43/src/control.rs index cd890c982..8944865c1 100644 --- a/cyw43/src/control.rs +++ b/cyw43/src/control.rs | |||
| @@ -393,6 +393,24 @@ 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 | /// Closes access point. | ||
| 397 | pub async fn close_ap(&mut self) { | ||
| 398 | // Stop AP | ||
| 399 | self.set_iovar_u32x2("bss", 0, 0).await; // bss = BSS_DOWN | ||
| 400 | |||
| 401 | // Turn off AP mode | ||
| 402 | self.ioctl_set_u32(IOCTL_CMD_SET_AP, 0, 0).await; | ||
| 403 | |||
| 404 | // Temporarily set wifi down | ||
| 405 | self.down().await; | ||
| 406 | |||
| 407 | // Turn on APSTA mode | ||
| 408 | self.set_iovar_u32("apsta", 1).await; | ||
| 409 | |||
| 410 | // Set wifi up again | ||
| 411 | self.up().await; | ||
| 412 | } | ||
| 413 | |||
| 396 | /// Add specified address to the list of hardware addresses the device | 414 | /// 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 | 415 | /// 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 | 416 | /// to 10 addresses are supported by the firmware. Returns the number of |
