-
Notifications
You must be signed in to change notification settings - Fork 10
RDKEMW-13122: Wi‑Fi networks in the picker are not ordered by signal strength #271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
0ce9519
947efe0
9d78aa5
33640ff
f8dd069
50ba570
698ede0
4f87434
04ed27c
ab09123
f009542
ee200c3
f9a4fd7
18f390e
1052a81
c325fa6
4843974
aecaa69
3931423
1b4563a
7ea4552
58481ff
bbd8052
8369c8c
0b2da0c
21f37cc
eb54645
be800d2
816359f
875a2d5
a905d94
f0648e6
a9bf226
a614e57
ef0c300
dc7c7cc
8b675ad
a6194c1
86cd3be
4ab22c3
e62854c
cb62c88
326a300
27476d7
e499cbe
afddfa2
a574270
937e39f
ad1994a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| /** | ||
|
Check failure on line 1 in interface/INetworkManager.h
|
||
| * If not stated otherwise in this file or this component's LICENSE | ||
| * file the following copyright and licenses apply: | ||
| * | ||
|
|
@@ -30,7 +30,14 @@ | |
| ID_NETWORKMANAGER = 0x800004E0, | ||
| ID_NETWORKMANAGER_NOTIFICATION = ID_NETWORKMANAGER + 1, | ||
| ID_NETWORKMANAGER_INTERFACE_DETAILS_ITERATOR = ID_NETWORKMANAGER + 2, | ||
| ID_NETWORKMANAGER_WIFI_SECURITY_MODE_ITERATOR = ID_NETWORKMANAGER + 3 | ||
| ID_NETWORKMANAGER_WIFI_SECURITY_MODE_ITERATOR = ID_NETWORKMANAGER + 3, | ||
| ID_NETWORKMANAGER_INTERFACE_STATE_NOTIFICATION = ID_NETWORKMANAGER + 4, | ||
| ID_NETWORKMANAGER_ACTIVE_INTERFACE_NOTIFICATION = ID_NETWORKMANAGER + 5, | ||
| ID_NETWORKMANAGER_IP_ADDRESS_NOTIFICATION = ID_NETWORKMANAGER + 6, | ||
| ID_NETWORKMANAGER_INTERNET_STATUS_NOTIFICATION = ID_NETWORKMANAGER + 7, | ||
| ID_NETWORKMANAGER_AVAILABLE_SSIDS_NOTIFICATION = ID_NETWORKMANAGER + 8, | ||
| ID_NETWORKMANAGER_WIFI_STATE_NOTIFICATION = ID_NETWORKMANAGER + 9, | ||
| ID_NETWORKMANAGER_WIFI_SIGNAL_NOTIFICATION = ID_NETWORKMANAGER + 10 | ||
| }; | ||
|
|
||
| /* @json @text:keep */ | ||
|
|
@@ -130,10 +137,10 @@ | |
| string ssid; | ||
| string bssid; | ||
| WIFISecurityMode security; | ||
| string strength; | ||
| string frequency; | ||
| string rate; | ||
| string noise; | ||
| int32_t strength; | ||
| double frequency; | ||
| int32_t rate; | ||
| int32_t noise; | ||
| }; | ||
|
|
||
| struct EXTERNAL WIFISecurityModeInfo { | ||
|
|
@@ -252,7 +259,7 @@ | |
| virtual uint32_t StartWPS(const WiFiWPS& method /* @in */, const string& pin /* @in */) = 0; | ||
| virtual uint32_t StopWPS(void) = 0; | ||
| virtual uint32_t GetWifiState(WiFiState &state /* @out */) = 0; | ||
| virtual uint32_t GetWiFiSignalQuality(string& ssid /* @out */, string& strength /* @out */, string& noise /* @out */, string& snr /* @out */, WiFiSignalQuality& quality /* @out */) = 0; | ||
| virtual uint32_t GetWiFiSignalQuality(string& ssid /* @out */, int& strength /* @out */, int& noise /* @out */, int& snr /* @out */, WiFiSignalQuality& quality /* @out */) = 0; | ||
| virtual uint32_t GetSupportedSecurityModes(ISecurityModeIterator*& modes/* @out */) const = 0; | ||
|
|
||
| /* @brief Set the network manager plugin log level */ | ||
|
|
@@ -263,25 +270,76 @@ | |
| virtual uint32_t Configure(const string configLine/* @in */) = 0; | ||
|
|
||
| /* @event */ | ||
| struct EXTERNAL INotification : virtual public Core::IUnknown | ||
| struct EXTERNAL IInterfaceStateChangeNotification : virtual public Core::IUnknown | ||
| { | ||
| enum { ID = ID_NETWORKMANAGER_NOTIFICATION }; | ||
| enum { ID = ID_NETWORKMANAGER_INTERFACE_STATE_NOTIFICATION }; | ||
|
|
||
| // Network Notifications that other processes can subscribe to | ||
| virtual void onInterfaceStateChange(const InterfaceState state /* @in */, const string interface /* @in */) = 0; | ||
| }; | ||
|
|
||
| /* @event */ | ||
| struct EXTERNAL IActiveInterfaceChangeNotification : virtual public Core::IUnknown | ||
| { | ||
| enum { ID = ID_NETWORKMANAGER_ACTIVE_INTERFACE_NOTIFICATION }; | ||
|
|
||
| virtual void onActiveInterfaceChange(const string prevActiveInterface /* @in */, const string currentActiveInterface /* @in */) = 0; | ||
| }; | ||
|
|
||
| /* @event */ | ||
| struct EXTERNAL IIPAddressChangeNotification : virtual public Core::IUnknown | ||
| { | ||
| enum { ID = ID_NETWORKMANAGER_IP_ADDRESS_NOTIFICATION }; | ||
|
|
||
| virtual void onIPAddressChange(const string interface /* @in */, const string ipversion /* @in */, const string ipaddress /* @in */, const IPStatus status /* @in */) = 0; | ||
| }; | ||
|
|
||
| /* @event */ | ||
| struct EXTERNAL IInternetStatusChangeNotification : virtual public Core::IUnknown | ||
| { | ||
| enum { ID = ID_NETWORKMANAGER_INTERNET_STATUS_NOTIFICATION }; | ||
|
|
||
| virtual void onInternetStatusChange(const InternetStatus prevState /* @in */, const InternetStatus currState /* @in */, const string interface /* @in */) = 0; | ||
| }; | ||
|
|
||
| /* @event */ | ||
| struct EXTERNAL IAvailableSSIDsNotification : virtual public Core::IUnknown | ||
| { | ||
| enum { ID = ID_NETWORKMANAGER_AVAILABLE_SSIDS_NOTIFICATION }; | ||
|
|
||
| // WiFi Notifications that other processes can subscribe to | ||
| virtual void onAvailableSSIDs(const string jsonOfScanResults /* @in */) = 0; | ||
| }; | ||
|
|
||
| /* @event */ | ||
| struct EXTERNAL IWiFiStateChangeNotification : virtual public Core::IUnknown | ||
| { | ||
| enum { ID = ID_NETWORKMANAGER_WIFI_STATE_NOTIFICATION }; | ||
|
|
||
| virtual void onWiFiStateChange(const WiFiState state /* @in */) = 0; | ||
| virtual void onWiFiSignalQualityChange(const string ssid /* @in */, const string strength /* @in */, const string noise /* @in */, const string snr /* @in */, const WiFiSignalQuality quality /* @in */) = 0; | ||
| }; | ||
|
|
||
| /* @event */ | ||
| struct EXTERNAL IWiFiSignalQualityChangeNotification : virtual public Core::IUnknown | ||
| { | ||
| enum { ID = ID_NETWORKMANAGER_WIFI_SIGNAL_NOTIFICATION }; | ||
|
|
||
| virtual void onWiFiSignalQualityChange(const string ssid /* @in */, const int strength /* @in */, const int noise /* @in */, const int snr /* @in */, const WiFiSignalQuality quality /* @in */) = 0; | ||
| }; | ||
|
|
||
| // Allow other processes to register/unregister from our notifications | ||
| virtual uint32_t Register(INetworkManager::INotification* notification) = 0; | ||
| virtual uint32_t Unregister(INetworkManager::INotification* notification) = 0; | ||
| virtual uint32_t RegisterInterfaceStateChangeNotification(IInterfaceStateChangeNotification* notification) = 0; | ||
| virtual uint32_t UnregisterInterfaceStateChangeNotification(IInterfaceStateChangeNotification* notification) = 0; | ||
| virtual uint32_t RegisterActiveInterfaceChangeNotification(IActiveInterfaceChangeNotification* notification) = 0; | ||
| virtual uint32_t UnregisterActiveInterfaceChangeNotification(IActiveInterfaceChangeNotification* notification) = 0; | ||
| virtual uint32_t RegisterIPAddressChangeNotification(IIPAddressChangeNotification* notification) = 0; | ||
| virtual uint32_t UnregisterIPAddressChangeNotification(IIPAddressChangeNotification* notification) = 0; | ||
| virtual uint32_t RegisterInternetStatusChangeNotification(IInternetStatusChangeNotification* notification) = 0; | ||
| virtual uint32_t UnregisterInternetStatusChangeNotification(IInternetStatusChangeNotification* notification) = 0; | ||
| virtual uint32_t RegisterAvailableSSIDsNotification(IAvailableSSIDsNotification* notification) = 0; | ||
| virtual uint32_t UnregisterAvailableSSIDsNotification(IAvailableSSIDsNotification* notification) = 0; | ||
| virtual uint32_t RegisterWiFiStateChangeNotification(IWiFiStateChangeNotification* notification) = 0; | ||
| virtual uint32_t UnregisterWiFiStateChangeNotification(IWiFiStateChangeNotification* notification) = 0; | ||
| virtual uint32_t RegisterWiFiSignalQualityChangeNotification(IWiFiSignalQualityChangeNotification* notification) = 0; | ||
| virtual uint32_t UnregisterWiFiSignalQualityChangeNotification(IWiFiSignalQualityChangeNotification* notification) = 0; | ||
| }; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -400,11 +400,12 @@ namespace WPEFramework | |
| { | ||
| response["ssid"] = ssidInfo.ssid; | ||
| response["bssid"] = ssidInfo.bssid; | ||
| response["rate"] = ssidInfo.rate; | ||
| response["noise"] = ssidInfo.noise; | ||
| response["rate"] = to_string(ssidInfo.rate); | ||
| response["noise"] = to_string(ssidInfo.noise); | ||
| response["security"] = JsonValue(mapToLegacySecurityMode(ssidInfo.security)); | ||
| response["signalStrength"] = ssidInfo.strength; | ||
| response["frequency"] = ssidInfo.frequency; | ||
| response["signalStrength"] = to_string(ssidInfo.strength); | ||
| std::string freqStr = to_string(ssidInfo.frequency); | ||
| response["frequency"] = freqStr.substr(0, 3); | ||
gururaajar marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
| returnJson(rc); | ||
| } | ||
|
|
@@ -911,10 +912,15 @@ namespace WPEFramework | |
| { | ||
| JsonObject object = ssids[i].Object(); | ||
| uint32_t security = object["security"].Number(); | ||
| object["security"] = mapToLegacySecurityMode(security); | ||
| ssidsUpdated.Add(object); | ||
| JsonObject newObject; | ||
| newObject["ssid"] = object["ssid"]; | ||
| newObject["security"] = mapToLegacySecurityMode(security); | ||
| newObject["signalStrength"] = object["strength"]; | ||
| newObject["frequency"] = object["frequency"]; | ||
| ssidsUpdated.Add(newObject); | ||
| } | ||
| newParameters["ssids"] = ssidsUpdated; | ||
| newParameters["moreData"] = false; | ||
|
||
|
|
||
| newParameters.ToString(json); | ||
| NMLOG_INFO("Event with %d SSIDs as, %s", ssids.Length(), json.c_str()); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a breaking API change that modifies the types of signal quality fields from strings to numeric types. This should be documented in the CHANGELOG.md file with a new version entry under the "Changed" category to inform API consumers about the breaking change.