RDK-61444 : Network Manager Plugin to support Scan Specific SSID#306
RDK-61444 : Network Manager Plugin to support Scan Specific SSID#306jincysam87 wants to merge 77 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the GNOME NetworkManager WiFi scan path to support scanning with multiple SSID filters (instead of a single optional SSID string), aligning the plugin with the requirement to “scan multiple SSIDs”.
Changes:
- Updated
wifiScanRequestAPI to accept astd::vector<std::string>of SSIDs to filter. - Built a
GVariantaaySSID list fornm_device_wifi_request_scan_options_async()when filters are provided; otherwise falls back to a normal scan. - Updated the GNOME proxy to pass the SSID filter list through to the WiFi manager.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| plugin/gnome/NetworkManagerGnomeWIFI.h | Changes wifiScanRequest signature to take a vector of SSIDs. |
| plugin/gnome/NetworkManagerGnomeWIFI.cpp | Implements building a multi-SSID scan options payload and triggers filtered vs unfiltered scan. |
| plugin/gnome/NetworkManagerGnomeProxy.cpp | Passes the SSID filter list to the updated scan request API. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| bool wifiConnectedSSIDInfo(Exchange::INetworkManager::WiFiSSIDInfo &ssidinfo); | ||
| bool wifiConnect(const Exchange::INetworkManager::WiFiConnectTo &ssidInfo); | ||
| bool wifiScanRequest(std::string ssidReq = ""); | ||
| bool wifiScanRequest(std::vector<std::string> ssidsToFilter = {}); |
| if(!ssidsToFilter.empty()) | ||
| { | ||
| NMLOG_INFO("starting wifi scanning .. %s", ssidReq.c_str()); | ||
| NMLOG_INFO("Starting wifi scanning for %d SSIDs:", ssidsToFilter.size()); |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
| bool wifiConnectedSSIDInfo(Exchange::INetworkManager::WiFiSSIDInfo &ssidinfo); | ||
| bool wifiConnect(const Exchange::INetworkManager::WiFiConnectTo &ssidInfo); | ||
| bool wifiScanRequest(std::string ssidReq = ""); | ||
| bool wifiScanRequest(std::vector<std::string> ssidsToFilter = {}); |
| if(!ssidsToFilter.empty()) | ||
| { | ||
| NMLOG_INFO("starting wifi scanning .. %s", ssidReq.c_str()); | ||
| NMLOG_INFO("Starting wifi scanning for %d SSIDs:", ssidsToFilter.size()); |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 17 out of 17 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (2)
tests/l2Test/rdk/l2_test_rdkproxy.cpp:677
- This test payload uses the
frequencyparameter name, but the JSON-RPC API implementation/docs forStartWiFiScannow expectfrequencies(plural) as an array. As-is, this test can still pass without validating the new request shape.
EXPECT_EQ(Core::ERROR_NONE, handler.Invoke(connection, _T("StartWiFiScan"),
_T("{\"frequency\":[\"2.4\"]}"), response));
EXPECT_EQ(response, _T("{\"success\":false}"));
plugin/NetworkManagerJsonRpc.cpp:683
index.Current().String()already returns astd::string. Converting it toc_str()and then back tostd::stringis unnecessary and can truncate values containing embedded NULs (possible in SSIDs represented as JSON strings with \u0000). Push thestd::stringdirectly.
if (Core::JSON::Variant::type::STRING == index.Current().Content())
{
ssidslist.push_back(index.Current().String().c_str());
}
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 17 out of 17 changed files in this pull request and generated 4 comments.
Comments suppressed due to low confidence (1)
tests/l2Test/rdk/l2_test_rdkproxy.cpp:677
- The JSON-RPC StartWiFiScan handler expects
frequencies(plural). Usingfrequencyhere means the test does not validate the updated API contract and may ignore the provided filter.
EXPECT_EQ(Core::ERROR_NONE, handler.Invoke(connection, _T("StartWiFiScan"),
_T("{\"frequency\":[\"2.4\"]}"), response));
EXPECT_EQ(response, _T("{\"success\":false}"));
karuna2git
left a comment
There was a problem hiding this comment.
Changes looks good to me.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 18 out of 18 changed files in this pull request and generated 4 comments.
Comments suppressed due to low confidence (2)
plugin/gnome/NetworkManagerGnomeWIFI.cpp:1995
- This log message is inaccurate: connectionBuilder() failure is not related to a "nm_variant" here, which makes troubleshooting harder.
if(!connectionBuilder(wifiConnectInfo, connection, true))
{
NMLOG_ERROR("wps connection builder failed");
break;
interface/INetworkManager.h:112
- WIFIFrequency
@textannotations still use "2.4GHz"/"5GHz"/"6GHz", while the updated JSON/API documentation and enum conversion map use "2.4"/"5"/"6". This mismatch can lead to inconsistent string<->enum conversions and regenerated schema drift.
enum WIFIFrequency : uint8_t
{
WIFI_FREQUENCY_ALL /* @text: ALL */,
WIFI_FREQUENCY_2_4_GHZ /* @text: 2.4GHz */,
WIFI_FREQUENCY_5_GHZ /* @text: 5GHz */,
WIFI_FREQUENCY_6_GHZ /* @text: 6GHz */,
};
| EXPECT_EQ(Core::ERROR_NONE, handler.Invoke(connection, _T("StartWiFiScan"), | ||
| _T("{\"frequency\":\"2.4GHz\"}"), response)); | ||
| _T("{\"frequency\":[\"2.4\"]}"), response)); | ||
| EXPECT_EQ(response, _T("{\"success\":true}")); |
| EXPECT_EQ(Core::ERROR_NONE, handler.Invoke(connection, _T("StartWiFiScan"), | ||
| _T("{\"frequency\":\"2.4GHz\"}"), response)); | ||
| _T("{\"frequency\":[\"2.4\"]}"), response)); | ||
| EXPECT_EQ(response, _T("{\"success\":false}")); |
| if (parameters.HasLabel("frequencies")) | ||
| { | ||
| JsonArray array = parameters["frequencies"].Array(); | ||
| std::vector<std::string> frequencyList; | ||
| JsonArray::Iterator index(array.Elements()); |
| string frequency = object["frequency"].String(); | ||
|
|
||
|
|
||
| double frequencyValue = std::stod(frequency); | ||
| bool ssidMatches = scanForSsidsSet.empty() || scanForSsidsSet.find(ssid) != scanForSsidsSet.end(); | ||
| bool freqMatches = m_filterfrequency.empty() || (filterFreq == frequencyValue); | ||
| bool freqMatches = m_filterFrequencies.empty(); |
Reason for change: Support to scan multiple SSIDs
Test Procedure: Test wifi scan API with multiple SSIDs
Risks: Low
Signed-off-by: jincysaramma_sam@comcast.com