Commit f34af3e4 authored by Oliver Joos's avatar Oliver Joos Committed by Damien George

extmod/network_cyw43: Add support to get STA RSSI using status() method.

This enables the use of WLAN(0).status('rssi') to get current RSSI of the
AP that the STA is connected to.
Signed-off-by: default avatarDamien George <damien@micropython.org>
parent 11b5ee0d
......@@ -314,6 +314,14 @@ STATIC mp_obj_t network_cyw43_status(size_t n_args, const mp_obj_t *args) {
// one argument: return status based on query parameter
switch (mp_obj_str_get_qstr(args[1])) {
case MP_QSTR_rssi: {
if (self->itf != CYW43_ITF_STA) {
mp_raise_ValueError(MP_ERROR_TEXT("STA required"));
}
int32_t rssi;
cyw43_wifi_get_rssi(self->cyw, &rssi);
return mp_obj_new_int(rssi);
}
case MP_QSTR_stations: {
// return list of connected stations
if (self->itf != CYW43_ITF_AP) {
......
Markdown is supported
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