circuitpython/extmod
Angus Gratton 181800eebd 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>
2024-11-20 14:42:26 +11:00
..
asyncio extmod/asyncio: Make current_task raise exception when there is no task. 2024-02-28 15:48:51 +11:00
axtls-include all: Prune trailing whitespace. 2024-03-07 16:25:17 +11:00
berkeley-db all: Update extmod, ports, examples to build with new berkeley-db lib. 2024-03-16 12:19:12 +11:00
btstack all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
libmetal extmod/libmetal: Fix libmetal rules for mkdir dependencies. 2024-09-06 17:14:03 +10:00
lwip-include all: Unify header guard usage. 2017-07-18 11:57:39 +10:00
mbedtls extmod/modtls_mbedtls: Support alternate sign callbacks in Python. 2024-10-25 01:16:06 +11:00
nimble extmod/nimble: Remove asserts of ediv_rand_present and adjust comments. 2024-11-05 11:27:06 +11:00
extmod.cmake extmod/network_ppp_lwip: Add network.PPP via lwIP. 2024-08-29 23:46:13 +10:00
extmod.mk extmod/modtls_mbedtls: Support alternate sign callbacks in Python. 2024-10-25 01:16:06 +11:00
font_petme128_8x8.h extmod: Move font_petme128_8x8.h from ports/stm32 to extmod. 2022-05-05 13:30:40 +10:00
machine_adc.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
machine_adc_block.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
machine_bitstream.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
machine_i2c.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
machine_i2s.c esp32/machine_i2s: Integrate new I2S IDF driver. 2024-03-08 13:31:02 +11:00
machine_mem.c extmod/modmachine: Add MICROPY_PY_MACHINE_MEMX configuration option. 2024-03-15 12:04:34 +11:00
machine_pinbase.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
machine_pulse.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
machine_pwm.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
machine_signal.c extmod/modmachine: Add MICROPY_PY_MACHINE_SIGNAL configuration option. 2024-03-15 12:04:25 +11:00
machine_spi.c extmod/machine_spi: Support firstbit=LSB for machine.SoftSPI. 2024-07-12 22:59:31 +10:00
machine_timer.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
machine_uart.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
machine_usb_device.c extmod/machine_usb_device: Add USBDevice.remote_wakeup method. 2024-07-02 10:23:26 +10:00
machine_wdt.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
misc.h extmod/os_dupterm: Let mp_os_dupterm_tx_strn() return num bytes written. 2023-12-22 10:26:52 +11:00
modasyncio.c extmod/modasyncio: Add support for a callback on TaskQueue push. 2024-06-20 00:11:05 +10:00
modbinascii.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
modbluetooth.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
modbluetooth.h all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
modbtree.c extmod/modbtree: Add checks for already-closed database. 2024-07-22 10:42:29 +10:00
modcryptolib.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
moddeflate.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
modframebuf.c extmod/modframebuf: Fix FrameBuffer size check for stride corner-cases. 2024-10-22 13:05:31 +11:00
modhashlib.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
modheapq.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
modjson.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
modlwip.c extmod/modlwip: Don't allow writing to a TCP socket that is connecting. 2024-11-13 11:44:09 +11:00
modmachine.c extmod/modmachine: Use sys.exit as implementation of machine.soft_reset. 2024-07-20 12:18:07 +10:00
modmachine.h extmod/machine_usb_device: Add support for Python USB devices. 2024-03-15 14:22:11 +11:00
modnetwork.c extmod/network_ppp_lwip: Add network.PPP via lwIP. 2024-08-29 23:46:13 +10:00
modnetwork.h extmod/network_ppp_lwip: Add network.PPP via lwIP. 2024-08-29 23:46:13 +10:00
modonewire.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
modopenamp.c extmod/modopenamp: Use mp_event_* functions for poll/wait. 2024-08-08 18:02:21 +10:00
modopenamp.h extmod/modopenamp_remoteproc: Add new OpenAMP RemoteProc class. 2024-03-15 18:11:28 +11:00
modopenamp_remoteproc.c extmod/modopenamp: Add support for building Open-AMP on device side. 2024-08-08 17:59:32 +10:00
modopenamp_remoteproc.h extmod/modopenamp_remoteproc: Add new OpenAMP RemoteProc class. 2024-03-15 18:11:28 +11:00
modopenamp_remoteproc_store.c extmod/modopenamp: Add support for building Open-AMP on device side. 2024-08-08 17:59:32 +10:00
modos.c extmod/modos: Include os.sep entry if MICROPY_VFS is enabled. 2024-07-20 12:32:31 +10:00
modplatform.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
modplatform.h extmod/modplatform: Add picolibc to the recognised libcs list. 2024-06-17 13:12:54 +10:00
modrandom.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
modre.c py: Add new cstack API for stack checking, with limit margin macro. 2024-08-14 12:55:45 +10:00
modselect.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
modsocket.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
modtime.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
modtime.h all: Rename *umodule*.h to remove the "u" prefix. 2023-06-08 17:54:14 +10:00
modtls_axtls.c extmod/modtls_axtls: Add verify_mode and CERT_NONE constant. 2024-03-28 17:36:13 +11:00
modtls_mbedtls.c extmod/modtls_mbedtls: Support alternate sign callbacks in Python. 2024-10-25 01:16:06 +11:00
moductypes.c extmod/moductypes: Validate the descriptor tuple. 2024-07-22 14:40:45 +10:00
modvfs.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
modwebrepl.c all: Use new mp_obj_new_str_from_cstr() function. 2024-07-04 15:55:03 +10:00
modwebsocket.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
modwebsocket.h all: Rename *umodule*.h to remove the "u" prefix. 2023-06-08 17:54:14 +10:00
mpbthci.c extmod/modbluetooth: Refactor stack/hci/driver/port bindings. 2020-09-08 11:41:31 +10:00
mpbthci.h extmod/nimble: Add support for reading whole HCI UART packets. 2022-06-03 11:53:28 +10:00
network_cyw43.c extmod/network_cyw43: Allow configuring active AP interface. 2024-11-20 14:42:26 +11:00
network_cyw43.h extmod: Add network-level class binding to cyw43 driver. 2019-06-03 16:47:35 +10:00
network_esp_hosted.c all: Use new mp_obj_new_str_from_cstr() function. 2024-07-04 15:55:03 +10:00
network_lwip.c all: Use new mp_obj_new_str_from_cstr() function. 2024-07-04 15:55:03 +10:00
network_ninaw10.c extmod/network_nina: Fix the AP security mode constants. 2024-07-12 01:03:46 +10:00
network_ppp_lwip.c extmod/network_ppp: Allow stream=None to suspend PPP. 2024-11-13 13:11:32 +11:00
network_wiznet5k.c extmod/network_wiznet5k: Reset mDNS when interface is brought up. 2024-10-23 16:29:28 +11:00
os_dupterm.c extmod/os_dupterm: Handle exception properly when it occurs in parallel. 2024-03-16 10:59:03 +11:00
vfs.c extmod/vfs: Fix buffer overflow of string comparison in umount. 2024-07-23 12:13:49 +10:00
vfs.h py/builtin: Clean up and simplify import_stat and builtin_open config. 2022-05-25 13:04:45 +10:00
vfs_blockdev.c extmod/vfs_blockdev: Support bool return from Python read/write blocks. 2024-11-13 14:21:29 +11:00
vfs_fat.c extmod/vfs_fat: Set default volume label on mkfs if it's defined. 2024-07-23 11:39:17 +10:00
vfs_fat.h extmod: Factor out block-device struct to make independent of fatfs. 2019-10-29 12:12:37 +11:00
vfs_fat_diskio.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
vfs_fat_file.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
vfs_lfs.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
vfs_lfs.h extmod: Add VFS littlefs bindings. 2019-10-29 14:17:29 +11:00
vfs_lfsx.c all: Use new mp_obj_new_str_from_cstr() function. 2024-07-04 15:55:03 +10:00
vfs_lfsx_file.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
vfs_posix.c all: Use new mp_obj_new_str_from_cstr() function. 2024-07-04 15:55:03 +10:00
vfs_posix.h extmod/vfs: Introduce a C-level VFS protocol, with fast import_stat. 2018-06-06 14:33:42 +10:00
vfs_posix_file.c extmod/vfs_posix_file: Skip flush of tty handles in msvc debug builds. 2024-10-09 15:03:07 +11:00
vfs_reader.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
virtpin.c py/obj: Add accessors for type slots and use everywhere. 2022-09-19 19:06:07 +10:00
virtpin.h all: Unify header guard usage. 2017-07-18 11:57:39 +10:00