RDK-61444 : Network Manager Plugin to support Scan Specific SSID#306
Open
jincysam87 wants to merge 22 commits into
Open
RDK-61444 : Network Manager Plugin to support Scan Specific SSID#306jincysam87 wants to merge 22 commits into
jincysam87 wants to merge 22 commits into
Conversation
Contributor
Contributor
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>
Contributor
| 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>
Contributor
Contributor
Contributor
Comment on lines
+1699
to
+1707
| if(!ssidsToFilter.empty()) | ||
| { | ||
| NMLOG_INFO("starting wifi scanning .. %s", ssidReq.c_str()); | ||
| NMLOG_INFO("Starting wifi scanning for %d SSIDs:",static_cast<int>(ssidsToFilter.size())); | ||
| GVariantBuilder builder, array_builder; | ||
| GVariant *options; | ||
| g_variant_builder_init(&builder, G_VARIANT_TYPE_VARDICT); | ||
| g_variant_builder_init(&array_builder, G_VARIANT_TYPE("aay")); | ||
| g_variant_builder_add(&array_builder, "@ay", | ||
| g_variant_new_fixed_array(G_VARIANT_TYPE_BYTE, (const guint8 *) ssidReq.c_str(), ssidReq.length(), 1) | ||
| ); | ||
| for (const auto& ssid : ssidsToFilter) { | ||
| if (!ssid.empty()) { |
Comment on lines
1688
to
1716
| @@ -1696,23 +1696,27 @@ namespace WPEFramework | |||
| return false; | |||
| } | |||
| m_isSuccess = false; | |||
| if(!ssidReq.empty()) | |||
| if(!ssidsToFilter.empty()) | |||
| { | |||
| NMLOG_INFO("starting wifi scanning .. %s", ssidReq.c_str()); | |||
| NMLOG_INFO("Starting wifi scanning for %d SSIDs:",static_cast<int>(ssidsToFilter.size())); | |||
| GVariantBuilder builder, array_builder; | |||
| GVariant *options; | |||
| g_variant_builder_init(&builder, G_VARIANT_TYPE_VARDICT); | |||
| g_variant_builder_init(&array_builder, G_VARIANT_TYPE("aay")); | |||
| g_variant_builder_add(&array_builder, "@ay", | |||
| g_variant_new_fixed_array(G_VARIANT_TYPE_BYTE, (const guint8 *) ssidReq.c_str(), ssidReq.length(), 1) | |||
| ); | |||
| for (const auto& ssid : ssidsToFilter) { | |||
| if (!ssid.empty()) { | |||
| g_variant_builder_add(&array_builder, "@ay", | |||
| g_variant_new_fixed_array(G_VARIANT_TYPE_BYTE, (const guint8 *) ssid.c_str(), ssid.length(), 1) | |||
| ); | |||
| } | |||
| } | |||
| g_variant_builder_add(&builder, "{sv}", "ssids", g_variant_builder_end(&array_builder)); | |||
| options = g_variant_builder_end(&builder); | |||
| nm_device_wifi_request_scan_options_async(wifiDevice, options, m_cancellable, wifiScanCb, this); | |||
| g_variant_unref(options); // Unreference the GVariant after passing it to the async function | |||
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Contributor
Comment on lines
1705
to
+1709
| g_variant_builder_init(&array_builder, G_VARIANT_TYPE("aay")); | ||
| g_variant_builder_add(&array_builder, "@ay", | ||
| g_variant_new_fixed_array(G_VARIANT_TYPE_BYTE, (const guint8 *) ssidReq.c_str(), ssidReq.length(), 1) | ||
| ); | ||
| for (const auto& ssid : ssidsToFilter) { | ||
| g_variant_builder_add(&array_builder, "@ay", | ||
| g_variant_new_fixed_array(G_VARIANT_TYPE_BYTE, (const guint8 *) ssid.c_str(), ssid.length(), 1) | ||
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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