diff options
-rw-r--r-- | libs/iwinfo/src/iwinfo.h | 3 | ||||
-rw-r--r-- | libs/iwinfo/src/iwinfo_lualib.c | 10 | ||||
-rw-r--r-- | libs/iwinfo/src/iwinfo_wext_scan.c | 5 |
3 files changed, 18 insertions, 0 deletions
diff --git a/libs/iwinfo/src/iwinfo.h b/libs/iwinfo/src/iwinfo.h index c1b5b7a125..b19795cc8c 100644 --- a/libs/iwinfo/src/iwinfo.h +++ b/libs/iwinfo/src/iwinfo.h @@ -47,6 +47,9 @@ struct iwinfo_scanlist_entry { uint8_t ssid[IW_ESSID_MAX_SIZE+1]; uint8_t mode[8]; uint8_t channel; + uint8_t signal; + uint8_t quality; + uint8_t quality_max; struct iwinfo_crypto_entry crypto; }; diff --git a/libs/iwinfo/src/iwinfo_lualib.c b/libs/iwinfo/src/iwinfo_lualib.c index 0bd2fa59ab..a798d77290 100644 --- a/libs/iwinfo/src/iwinfo_lualib.c +++ b/libs/iwinfo/src/iwinfo_lualib.c @@ -150,6 +150,16 @@ static int iwinfo_L_scanlist(lua_State *L, int (*func)(const char *, char *, int lua_pushstring(L, (char *) e->mode); lua_setfield(L, -2, "mode"); + /* Quality, Signal */ + lua_pushinteger(L, e->quality); + lua_setfield(L, -2, "quality"); + + lua_pushinteger(L, e->quality_max); + lua_setfield(L, -2, "quality_max"); + + lua_pushnumber(L, (e->signal - 0x100)); + lua_setfield(L, -2, "signal"); + /* Crypto */ lua_pushinteger(L, e->crypto.wpa_version); lua_setfield(L, -2, "wpa"); diff --git a/libs/iwinfo/src/iwinfo_wext_scan.c b/libs/iwinfo/src/iwinfo_wext_scan.c index 1c15a1dd01..fcfecbb6f2 100644 --- a/libs/iwinfo/src/iwinfo_wext_scan.c +++ b/libs/iwinfo/src/iwinfo_wext_scan.c @@ -411,6 +411,11 @@ static inline int wext_fill_entry(struct stream_descr *stream, struct iw_event * e->crypto.enabled = !(event->u.data.flags & IW_ENCODE_DISABLED); break; + case IWEVQUAL: + e->signal = event->u.qual.level; + e->quality = event->u.qual.qual; + e->quality_max = iw_range->max_qual.qual; + break; #if 0 case SIOCGIWRATE: if(state->val_index == 0) |