diff options
| author | Glenn Moloney <glenn.moloney@gmail.com> | 2023-05-19 17:51:52 +1000 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2025-02-07 12:19:12 +1100 |
| commit | 4bed77cc233a84846a0c47347b520ce5b816758b (patch) | |
| tree | 000bf9ed35c25e77017c52a555f5d95245233a7d | |
| parent | 3699cf5f38736b670a26786af4025584dcb5aef2 (diff) | |
esp8266/network_wlan: Make WLAN.config('channel') use wifi_get_channel.
Prior to this fix, `WLAN.config('channel')` would return an incorrect
channel for AP_IF if STA has connected to an external AP running on a
different channel.
The esp8266 now has the same behaviour as for esp32 per commit
98d1c50159fe9427d72ec358ba0219eaebb1d991.
Fixes issue #11463.
Signed-off-by: Glenn Moloney <glenn.moloney@gmail.com>
| -rw-r--r-- | ports/esp8266/network_wlan.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/ports/esp8266/network_wlan.c b/ports/esp8266/network_wlan.c index 44154ff6d..2e43ebfb2 100644 --- a/ports/esp8266/network_wlan.c +++ b/ports/esp8266/network_wlan.c @@ -641,8 +641,7 @@ static mp_obj_t esp_config(size_t n_args, const mp_obj_t *args, mp_map_t *kwargs val = MP_OBJ_NEW_SMALL_INT(cfg.ap.authmode); break; case MP_QSTR_channel: - req_if = SOFTAP_IF; - val = MP_OBJ_NEW_SMALL_INT(cfg.ap.channel); + val = MP_OBJ_NEW_SMALL_INT(wifi_get_channel()); break; case MP_QSTR_hostname: case MP_QSTR_dhcp_hostname: { |
