Merge pull request #3042 from GustavToft/fix_main
Adding function to close soft AP.
This commit is contained in:
commit
5af0fe8a58
1 changed files with 18 additions and 0 deletions
|
@ -393,6 +393,24 @@ impl<'a> Control<'a> {
|
||||||
self.set_iovar_u32x2("bss", 0, 1).await; // bss = BSS_UP
|
self.set_iovar_u32x2("bss", 0, 1).await; // bss = BSS_UP
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Closes access point.
|
||||||
|
pub async fn close_ap(&mut self) {
|
||||||
|
// Stop AP
|
||||||
|
self.set_iovar_u32x2("bss", 0, 0).await; // bss = BSS_DOWN
|
||||||
|
|
||||||
|
// Turn off AP mode
|
||||||
|
self.ioctl_set_u32(IOCTL_CMD_SET_AP, 0, 0).await;
|
||||||
|
|
||||||
|
// Temporarily set wifi down
|
||||||
|
self.down().await;
|
||||||
|
|
||||||
|
// Turn on APSTA mode
|
||||||
|
self.set_iovar_u32("apsta", 1).await;
|
||||||
|
|
||||||
|
// Set wifi up again
|
||||||
|
self.up().await;
|
||||||
|
}
|
||||||
|
|
||||||
/// Add specified address to the list of hardware addresses the device
|
/// Add specified address to the list of hardware addresses the device
|
||||||
/// listens on. The address must be a Group address (I/G bit set). Up
|
/// listens on. The address must be a Group address (I/G bit set). Up
|
||||||
/// to 10 addresses are supported by the firmware. Returns the number of
|
/// to 10 addresses are supported by the firmware. Returns the number of
|
||||||
|
|
Loading…
Add table
Reference in a new issue