Commit 7e7039b5 authored by Josef Gajdusek's avatar Josef Gajdusek Committed by Paul Sokolovsky
Browse files

esp8266: Export station status() constants

parent 2378be4e
......@@ -36,6 +36,8 @@
#include "queue.h"
#include "user_interface.h"
#define MODESP_INCLUDE_CONSTANTS (1)
// Singleton instance of scan callback, meaning that there can be only
// one concurrent AP scan.
STATIC mp_obj_t scan_cb_obj;
......@@ -116,6 +118,21 @@ STATIC const mp_map_elem_t esp_module_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_disconnect), (mp_obj_t)&esp_disconnect_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_scan), (mp_obj_t)&esp_scan_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_status), (mp_obj_t)&esp_status_obj },
#if MODESP_INCLUDE_CONSTANTS
{ MP_OBJ_NEW_QSTR(MP_QSTR_STAT_IDLE),
MP_OBJ_NEW_SMALL_INT(STATION_IDLE)},
{ MP_OBJ_NEW_QSTR(MP_QSTR_STAT_CONNECTING),
MP_OBJ_NEW_SMALL_INT(STATION_CONNECTING)},
{ MP_OBJ_NEW_QSTR(MP_QSTR_STAT_WRONG_PASSWORD),
MP_OBJ_NEW_SMALL_INT(STATION_WRONG_PASSWORD)},
{ MP_OBJ_NEW_QSTR(MP_QSTR_STAT_NO_AP_FOUND),
MP_OBJ_NEW_SMALL_INT(STATION_NO_AP_FOUND)},
{ MP_OBJ_NEW_QSTR(MP_QSTR_STAT_CONNECT_FAIL),
MP_OBJ_NEW_SMALL_INT(STATION_CONNECT_FAIL)},
{ MP_OBJ_NEW_QSTR(MP_QSTR_STAT_GOT_IP),
MP_OBJ_NEW_SMALL_INT(STATION_GOT_IP)},
#endif
};
STATIC MP_DEFINE_CONST_DICT(esp_module_globals, esp_module_globals_table);
......
......@@ -46,6 +46,12 @@ Q(connect)
Q(disconnect)
Q(scan)
Q(status)
Q(STAT_IDLE)
Q(STAT_CONNECTING)
Q(STAT_WRONG_PASSWORD)
Q(STAT_NO_AP_FOUND)
Q(STAT_CONNECT_FAIL)
Q(STAT_GOT_IP)
// Pin class
Q(Pin)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment