aboutsummaryrefslogtreecommitdiff
path: root/cyw43
diff options
context:
space:
mode:
Diffstat (limited to 'cyw43')
-rw-r--r--cyw43/src/control.rs18
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