BSSID in vicious.widgets.wifiiw

This commit is contained in:
Xaver Hellauer 2019-07-18 20:34:42 +02:00 committed by Nguyễn Gia Phong
parent b8afc3aafc
commit ca075d0c8e
2 changed files with 2 additions and 1 deletions

View File

@ -538,7 +538,7 @@ vicious.widgets.wifi, but uses `iw` instead of `iwconfig`).
Supported platforms: GNU/Linux.
* Argument: the network interface, e.g. `"wlan0"`
* Returns a table with string keys: `${ssid}`, `${mode}`, `${chan}`,
* Returns a table with string keys: `${bssid}`, `${ssid}`, `${mode}`, `${chan}`,
`${rate}` (Mb/s), `${freq}` (MHz), `${linp}` (link quality in percent),
`${txpw}` (transmission power, in dBm) and `${sign}` (signal level, in dBm)

View File

@ -26,6 +26,7 @@ function wifiiw_linux.async(format, warg, callback)
local winfo = {}
local function parse_link(stdout)
winfo["{bssid}"] = stdout:match"Connected to ([%x:]*)" or "N/A"
winfo["{ssid}"] = stdout:match"SSID: ([^\n]*)" or "N/A"
winfo["{freq}"] = tonumber(stdout:match"freq: (%d+)" or 0)
winfo["{sign}"] = -- Signal level can be negative; w/o unit (dBm)