extmod/modnetwork: Add STA_IF and AP_IF constants.

This commit is contained in:
iabdalkader 2021-08-22 17:27:38 +02:00 committed by Damien George
parent 7aab0dc5d8
commit d889f672da
2 changed files with 7 additions and 0 deletions

View File

@ -110,6 +110,10 @@ STATIC const mp_rom_map_elem_t mp_module_network_globals_table[] = {
#if MICROPY_PY_NETWORK_CYW43
{ MP_ROM_QSTR(MP_QSTR_STA_IF), MP_ROM_INT(CYW43_ITF_STA)},
{ MP_ROM_QSTR(MP_QSTR_AP_IF), MP_ROM_INT(CYW43_ITF_AP)},
#else
// Station/AP mode.
{ MP_ROM_QSTR(MP_QSTR_STA_IF), MP_ROM_INT(MOD_NETWORK_STA_IF) },
{ MP_ROM_QSTR(MP_QSTR_AP_IF), MP_ROM_INT(MOD_NETWORK_AP_IF) },
#endif
};

View File

@ -35,6 +35,9 @@
#define MOD_NETWORK_SOCK_DGRAM (2)
#define MOD_NETWORK_SOCK_RAW (3)
#define MOD_NETWORK_STA_IF (0)
#define MOD_NETWORK_AP_IF (1)
#if MICROPY_PY_LWIP
struct netif;