mirror of
https://github.com/micropython/micropython.git
synced 2026-01-04 19:20:22 +01:00
esp32,mimxrt,stm32: Implement ipconfig() for more network interfaces.
Implements: - esp32: network.ipconfig() - esp32: network.LAN.ipconfig() - esp32: network.WLAN.ipconfig() - mimxrt: network.LAN.ipconfig() - stm32: network.LAN.ipconfig() Signed-off-by: Felix Dörre <felix@dogcraft.de>
This commit is contained in:
committed by
Damien George
parent
0e19286c94
commit
1f23ab1e3d
@@ -101,6 +101,12 @@ static mp_obj_t network_lan_ifconfig(size_t n_args, const mp_obj_t *args) {
|
||||
}
|
||||
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(network_lan_ifconfig_obj, 1, 2, network_lan_ifconfig);
|
||||
|
||||
static mp_obj_t network_lan_ipconfig(size_t n_args, const mp_obj_t *args, mp_map_t *kwargs) {
|
||||
network_lan_obj_t *self = MP_OBJ_TO_PTR(args[0]);
|
||||
return mod_network_nic_ipconfig(eth_netif(self->eth), n_args - 1, args + 1, kwargs);
|
||||
}
|
||||
static MP_DEFINE_CONST_FUN_OBJ_KW(network_lan_ipconfig_obj, 1, network_lan_ipconfig);
|
||||
|
||||
static mp_obj_t network_lan_status(size_t n_args, const mp_obj_t *args) {
|
||||
network_lan_obj_t *self = MP_OBJ_TO_PTR(args[0]);
|
||||
(void)self;
|
||||
@@ -163,6 +169,7 @@ static const mp_rom_map_elem_t network_lan_locals_dict_table[] = {
|
||||
{ MP_ROM_QSTR(MP_QSTR_active), MP_ROM_PTR(&network_lan_active_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_isconnected), MP_ROM_PTR(&network_lan_isconnected_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_ifconfig), MP_ROM_PTR(&network_lan_ifconfig_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_ipconfig), MP_ROM_PTR(&network_lan_ipconfig_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_status), MP_ROM_PTR(&network_lan_status_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_config), MP_ROM_PTR(&network_lan_config_obj) },
|
||||
|
||||
|
||||
Reference in New Issue
Block a user