Merge pull request #799 from larsks/feature/circuitpython/station-ssid

esp8266/modnetwork: Allow to get ESSID of AP that STA is connected to.
This commit is contained in:
Scott Shawcroft 2018-05-03 10:12:50 -07:00 committed by GitHub
commit a8bd37f14d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -410,8 +410,11 @@ STATIC mp_obj_t esp_config(size_t n_args, const mp_obj_t *args, mp_map_t *kwargs
return mp_obj_new_bytes(mac, sizeof(mac));
}
case QS(MP_QSTR_essid):
req_if = SOFTAP_IF;
if (self->if_id == STATION_IF) {
val = mp_obj_new_str((char*)cfg.sta.ssid, strlen((char*)cfg.sta.ssid), false);
} else {
val = mp_obj_new_str((char*)cfg.ap.ssid, cfg.ap.ssid_len, false);
}
break;
case QS(MP_QSTR_hidden):
req_if = SOFTAP_IF;