Skip to content
Snippets Groups Projects
Commit 55df14f1 authored by Damien George's avatar Damien George
Browse files

esp8266/modnetwork: scan() is only supported by STA when it's enabled.

parent 715ee9d9
Branches
Tags
No related merge requests found
......@@ -155,9 +155,10 @@ STATIC void esp_scan_cb(scaninfo *si, STATUS status) {
}
STATIC mp_obj_t esp_scan(mp_obj_t self_in) {
if (wifi_get_opmode() == SOFTAP_MODE) {
require_if(self_in, STATION_IF);
if ((wifi_get_opmode() & STATION_MODE) == 0) {
nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError,
"scan unsupported in AP mode"));
"STA must be active"));
}
mp_obj_t list = mp_obj_new_list(0, NULL);
esp_scan_list = &list;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment