esp8266/modnetwork: Add symbolic names for network interfaces: STA_IF & AP_IF.

These are expected to be passed to network.WLAN() to instantiate network
interface objects.
This commit is contained in:
Paul Sokolovsky 2016-02-20 01:38:17 +02:00
parent a49c16069c
commit 5239a8a82b
2 changed files with 7 additions and 0 deletions

View File

@ -323,6 +323,11 @@ STATIC const mp_map_elem_t mp_module_network_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_phy_mode), (mp_obj_t)&esp_phy_mode_obj },
#if MODNETWORK_INCLUDE_CONSTANTS
{ MP_OBJ_NEW_QSTR(MP_QSTR_STA_IF),
MP_OBJ_NEW_SMALL_INT(STATION_IF)},
{ MP_OBJ_NEW_QSTR(MP_QSTR_AP_IF),
MP_OBJ_NEW_SMALL_INT(SOFTAP_IF)},
{ MP_OBJ_NEW_QSTR(MP_QSTR_STAT_IDLE),
MP_OBJ_NEW_SMALL_INT(STATION_IDLE)},
{ MP_OBJ_NEW_QSTR(MP_QSTR_STAT_CONNECTING),

View File

@ -106,6 +106,8 @@ Q(isconnected)
Q(mac)
Q(config)
Q(ifconfig)
Q(STA_IF)
Q(AP_IF)
Q(STAT_IDLE)
Q(STAT_CONNECTING)
Q(STAT_WRONG_PASSWORD)