From 615a3cbe7ac97c73556fd5194c06e901eccd16de Mon Sep 17 00:00:00 2001 From: Gatis Paeglis Date: Tue, 24 Feb 2015 14:31:36 +0100 Subject: Fix signal calculation for WEXT-based drivers This patch introduces a behavior change. Previously the 'SignalStrength' role was interpreted as dBm. This was working fine for nl80211 based drivers, for WEXT-based drivers it contained garbage values. Now the 'SignalStrength' role will always be interpreted as percentage. The wpa_supplicant passes back only the 'level' of the scanned BSS, which with nl80211-based driver is almost always dBm (val < 0). WEXT-based driver has its own interpretation of 'level' - it can contain dBm, percentage [0-100] (and some other values for historical reasons, but these are converted by the wpa_supplicant to dBm). This is what I have concluded from looking at NetworkManager and wpa_supplicant sources and git history. Even the official GUI tool wpa_gui for the wpa_supplicant is out-of-date and can not be used as a referance. Change-Id: I70d15e26e0a1700ad0f7d19d23cbade2d3d46054 Reviewed-by: Eirik Aavitsland --- src/imports/wifi/pluginmain.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/imports/wifi') diff --git a/src/imports/wifi/pluginmain.cpp b/src/imports/wifi/pluginmain.cpp index 7d129d2..b498b66 100644 --- a/src/imports/wifi/pluginmain.cpp +++ b/src/imports/wifi/pluginmain.cpp @@ -93,13 +93,13 @@ QT_BEGIN_NAMESPACE interface, accessed with the following roles: \list - \li \e ssid - informal (human) name of a Wifi network - \li \e bssid - basic service set identification of a network, used to uniquely identify BSS - \li \e signalStrength - strength of a Wifi signal, measured in dBm - \li \e supportsWPA - holds whether network access point supports WPA security protocol - \li \e supportsWPA2 - holds whether network access point supports WPA2 security protocol - \li \e supportsWEP - holds whether network access point supports WEP security protocol - \li \e supportsWPS - holds whether network access point supports WPS security protocol + \li \e ssid - informal (human) name of a Wifi network (string) + \li \e bssid - basic service set identification of a network, used to uniquely identify BSS (string) + \li \e signalStrength - strength of a Wifi signal represented as percentage (0-100) (int) + \li \e supportsWPA - holds whether network access point supports WPA security protocol (bool) + \li \e supportsWPA2 - holds whether network access point supports WPA2 security protocol (bool) + \li \e supportsWEP - holds whether network access point supports WEP security protocol (bool) + \li \e supportsWPS - holds whether network access point supports WPS security protocol (bool) \endlist */ -- cgit v1.2.3