diff options
author | Angus Gratton <angus@redyak.com.au> | 2024-11-13 18:04:59 +1100 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2024-11-20 14:42:26 +1100 |
commit | 181800eebde2f3dbda2862c175150d884eef728d (patch) | |
tree | d78a3d5801475c72901dbc4cc7b90041d8edabc1 /py | |
parent | af743eaf59196e9133bd3c6de53cae1bb6c9a59a (diff) | |
download | micropython-181800eebde2f3dbda2862c175150d884eef728d.tar.gz micropython-181800eebde2f3dbda2862c175150d884eef728d.zip |
extmod/network_cyw43: Allow configuring active AP interface.
Configuring the AP for cyw43 writes to some buffers that are only sent to
the modem when the interface is brought up. This means you can't configure
the AP after calling active(True), the new settings seem to be accepted but
the radio doesn't change.
This is different to the WLAN behaviour on other ports. The esp8266 port
requires calling active(True) on the AP before configuring, even.
Fix this by bouncing the AP interface after a config change, if it's
active. Configuring with active(False) still works the same as before.
Adds a static variable to track interface active state, rather than relying
on the LWIP interface state. This is because the interface state is updated
by a driver callback and there's a race: if code calls active(True) and
then config(a=b) then the driver doesn't know it's active yet and the
changes aren't correctly applied.
It is possible this pattern will cause the AP to come up briefly with the
default "PICOabcd" SSID before being reconfigured, however (due to the
aforementioned race condition) it seems like this may not happen at all
before the new config is applied.
This work was funded through GitHub Sponsors.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
Diffstat (limited to 'py')
0 files changed, 0 insertions, 0 deletions