diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2009-08-24 14:23:49 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2009-08-24 14:23:49 +0000 |
commit | 0f242f2f503258c1902a9ea7317b04231360ec88 (patch) | |
tree | d5aab6a720256dfd1d8b806ec5e713b0a25bde2e | |
parent | 0e88acfd4ef3abd5af048fda14810a207681c913 (diff) |
libs/iwinfo: add signal and quality values to scan results
-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 c1b5b7a12..b19795cc8 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 0bd2fa59a..a798d7729 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 1c15a1dd0..fcfecbb6f 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) |