esp8266/modnetwork: Add support for wlan.ifconfig('dhcp').

Fixes issue #5780.
This commit is contained in:
Damien George 2020-03-22 00:01:39 +11:00
parent feb2577585
commit 9fa32169e9
1 changed files with 5 additions and 0 deletions

View File

@ -286,6 +286,11 @@ STATIC mp_obj_t esp_ifconfig(size_t n_args, const mp_obj_t *args) {
netutils_format_ipv4_addr((uint8_t *)&dns_addr, NETUTILS_BIG),
};
return mp_obj_new_tuple(4, tuple);
} else if (args[1] == MP_OBJ_NEW_QSTR(MP_QSTR_dhcp)) {
// use DHCP to configure the IP addresses
require_if(args[0], STATION_IF);
wifi_station_dhcpc_start();
return mp_const_none;
} else {
// set
mp_obj_t *items;