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

Following esp32.  This is preferred to using the phy_mode() function.
This commit is contained in:
glenn20 2022-08-12 16:53:48 +10:00 committed by Damien George
parent 0507f239e8
commit e6e60f4330

View File

@ -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;
}