esp8266/modnetwork: Add support for WLAN.config(protocol=XX) option.

Following esp32.  This is preferred to using the phy_mode() function.
pull/9058/head
glenn20 2022-08-12 16:53:48 +10:00 zatwierdzone przez Damien George
rodzic 0507f239e8
commit e6e60f4330
1 zmienionych plików z 8 dodań i 0 usunięć

Wyświetl plik

@ -406,6 +406,10 @@ STATIC mp_obj_t esp_config(size_t n_args, const mp_obj_t *args, mp_map_t *kwargs
}
break;
}
case MP_QSTR_protocol: {
wifi_set_phy_mode(mp_obj_get_int(kwargs->table[i].value));
break;
}
default:
goto unknown;
}
@ -473,6 +477,10 @@ STATIC mp_obj_t esp_config(size_t n_args, const mp_obj_t *args, mp_map_t *kwargs
}
break;
}
case MP_QSTR_protocol: {
val = mp_obj_new_int(wifi_get_phy_mode());
break;
}
default:
goto unknown;
}