libs/iwinfo: add signal and quality values to scan results
This commit is contained in:
parent
0e88acfd4e
commit
0f242f2f50
3 changed files with 18 additions and 0 deletions
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue