Browse Source

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.
pull/1879/head
Paul Sokolovsky 9 years ago
parent
commit
5239a8a82b
  1. 5
      esp8266/modnetwork.c
  2. 2
      esp8266/qstrdefsport.h

5
esp8266/modnetwork.c

@ -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),

2
esp8266/qstrdefsport.h

@ -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)

Loading…
Cancel
Save