Skip to content

RDKEMW-15309 : Improvements in Wifi Connection Processing in Network Manager plugin#284

Open
cmuhammedrafi wants to merge 18 commits intodevelopfrom
topic/RDK-60454-Dev
Open

RDKEMW-15309 : Improvements in Wifi Connection Processing in Network Manager plugin#284
cmuhammedrafi wants to merge 18 commits intodevelopfrom
topic/RDK-60454-Dev

Conversation

@cmuhammedrafi
Copy link
Copy Markdown
Contributor

Reason for change:

  1. bssid and frequency parameter support for wifiConnect Api added,
  2. New api added for connect to specific Wi-Fi connection

@cmuhammedrafi cmuhammedrafi requested a review from a team as a code owner March 6, 2026 14:13
Copilot AI review requested due to automatic review settings March 6, 2026 14:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds BSSID/frequency support to WiFi connection flow and introduces a new JSON-RPC API to connect using a saved/known SSID, with corresponding updates across the interface, implementations, schema/docs, and L2 tests.

Changes:

  • Extend WiFiConnect input to accept bssid and frequency (band) and include BSSID in scan/event payloads.
  • Add ConnectToKnownSSID API end-to-end (interface → implementations → JSON-RPC → docs/schema).
  • Update libnm L2 tests/mocks to cover the new API and expanded AP property usage.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 18 comments.

Show a summary per file
File Description
tests/mocks/INetworkManagerMock.h Extends mock interface with ConnectToKnownSSID.
tests/l2Test/libnm/l2_test_libnmproxyWifi.cpp Adds/adjusts WiFi connection tests including ConnectToKnownSSID and AP property mocks.
tests/l2Test/libnm/l2_test_libnmproxyEvent.cpp Updates scan/event test setup to accommodate BSSID/frequency additions and device handling.
plugin/rdk/NetworkManagerRDKProxy.cpp Adds RDK stub implementation for ConnectToKnownSSID (returns unavailable).
plugin/gnome/NetworkManagerGnomeWIFI.h Adds connectToKnownSSID to the WiFi manager interface.
plugin/gnome/NetworkManagerGnomeWIFI.cpp Implements BSSID-aware AP matching, band restriction, and connectToKnownSSID; refactors connected AP info retrieval.
plugin/gnome/NetworkManagerGnomeUtils.h Declares new BSSID validation helper.
plugin/gnome/NetworkManagerGnomeUtils.cpp Implements BSSID format validation.
plugin/gnome/NetworkManagerGnomeProxy.cpp Wires ConnectToKnownSSID; updates WiFiConnect flow and adds BSSID validation.
plugin/gnome/NetworkManagerGnomeEvents.cpp Adds BSSID to AP JSON and adjusts scan result handling/notification gating.
plugin/NetworkManagerLogger.cpp Changes default log level to DEBUG.
plugin/NetworkManagerJsonRpc.cpp Registers new JSON-RPC method; parses bssid/frequency for WiFiConnect.
plugin/NetworkManagerImplementation.h Adds ConnectToKnownSSID to the implementation interface.
plugin/NetworkManager.h Adds JSON-RPC handler declaration for ConnectToKnownSSID.
interface/INetworkManager.h Adds ConnectToKnownSSID, bssid/frequency fields, and WIFIFrequency enum.
docs/NetworkManagerPlugin.md Documents new API and adds bssid/frequency to WiFiConnect.
definition/NetworkManager.json Updates JSON-RPC schema with new method and new WiFiConnect parameters.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Copilot AI review requested due to automatic review settings March 9, 2026 07:07
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated 4 comments.

Comments suppressed due to low confidence (1)

plugin/gnome/NetworkManagerGnomeWIFI.cpp:1112

  • activeSSID is no longer populated, but it’s still used in the log message when the connected SSID differs (NMLOG_DEBUG("wifi already connected with %s AP", activeSSID.c_str())). This will always log an empty string and makes debugging misleading; consider logging connectedApInfo.ssid (or removing the variable/log entirely).
                }
                else
                    NMLOG_DEBUG("wifi already connected with %s AP", activeSSID.c_str());
            }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@cmuhammedrafi cmuhammedrafi changed the title RDK-60453 [NW-Plugin] BSSID Improvements in Wifi Connection Processing RDK-60454 : Improvements in Wifi Connection Processing in Network Manager plugin Mar 9, 2026
Copilot AI review requested due to automatic review settings March 9, 2026 10:04
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@cmuhammedrafi cmuhammedrafi changed the title RDK-60454 : Improvements in Wifi Connection Processing in Network Manager plugin RDKEMW-15309 : Improvements in Wifi Connection Processing in Network Manager plugin Mar 11, 2026
bpunnuru
bpunnuru previously approved these changes Mar 13, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated 8 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +827 to 847
if(!_nmEventInstance->doScanNotify)
{
NMLOG_DEBUG("wifi scan result received but notify is false, skipping event notify");
return;
}

NMLOG_INFO("No of AP Available = %d", static_cast<int>(accessPoints->len));

JsonArray ssidList = JsonArray();
for (guint i = 0; i < accessPoints->len; i++)
{
JsonObject ssidObj;
ap = static_cast<NMAccessPoint*>(accessPoints->pdata[i]);
JsonObject ssidObj{};
NMAccessPoint *ap = static_cast<NMAccessPoint*>(accessPoints->pdata[i]);
if(GnomeNetworkManagerEvents::apToJsonObject(ap, ssidObj))
ssidList.Add(ssidObj);
}

NMLOG_DEBUG("No of AP Available = %d", static_cast<int>(accessPoints->len));

if(_nmEventInstance->doScanNotify) {
if(_instance != nullptr) {
_nmEventInstance->doScanNotify = false;
_instance->ReportAvailableSSIDs(ssidList);
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes not needed

g_object_unref(deviceDummy);
g_object_unref(conn1);
g_object_unref(conn2);
g_object_unref(conn3);
bpunnuru
bpunnuru previously approved these changes Mar 18, 2026
Copy link
Copy Markdown

@bpunnuru bpunnuru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks Good

Copilot AI review requested due to automatic review settings March 18, 2026 18:45
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated 10 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +1042 to +1043
"summary": "Frequency band: `1` - 2.4GHz, `2` - 5GHz. If specified, connects only to SSIDs on the given frequency band. Defaults to best available.",
"type": "integer",
if(ssidGBytes)
if(ssidGBytes == nullptr)
{
NMLOG_DEBUG("hidden ssid found, bssid: %s", nm_access_point_get_bssid(ap));
Comment on lines +199 to +206
bool nmUtils::isValidBSSID(const std::string& bssid)
{
// Regular expression to match valid BSSID formats (e.g., "00:11:22:33:44:55")
const std::regex bssidRegex("^([0-9A-Fa-f]{2}[:]){5}([0-9A-Fa-f]{2})$");
if (!std::regex_match(bssid, bssidRegex))
{
NMLOG_ERROR("Invalid BSSID format: %s. Expected format is XX:XX:XX:XX:XX:XX where X is a hexadecimal digit.", bssid.c_str());
return false;
virtual uint32_t GetKnownSSIDs(IStringIterator*& ssids /* @out */) = 0;
virtual uint32_t AddToKnownSSIDs(const WiFiConnectTo& ssid /* @in */) = 0;
virtual uint32_t RemoveKnownSSID(const string& ssid /* @in */) = 0;
virtual uint32_t ConnectToKnownSSID(const string& ssid /* @in */) = 0;
## *GetPrimaryInterface [<sup>method</sup>](#head.Methods)*

Gets the primary/default network interface for the device. The active network interface is defined as the one that can make requests to the external network. Returns one of the supported interfaces as per `GetAvailableInterfaces`.
Gets the primary/default network interface for the device. The active network interface is defined as the one that can make requests to the external network. Returns one of the supported interfaces as per `GetAvailableInterfaces`. if no active network is available, it returns empty string.
NMLOG_WARNING("ssid is empty activating last connected ssid !");
if(_instance != NULL && wifi->activateKnownConnection(nmUtils::wlanIface(), _instance->m_lastConnectedSSID))
{
rc = Core::ERROR_NONE;
Comment on lines +844 to 847
if(_instance != nullptr) {
_nmEventInstance->doScanNotify = false;
_instance->ReportAvailableSSIDs(ssidList);
}
| params?.passphrase | string | <sup>*(optional)*</sup> The access point password |
| params?.security | integer | <sup>*(optional)*</sup> Optional override to explicitly select the security mode; if omitted, the mode is decided based on the highest security mode provided by the SSID. See `GetSupportedSecurityModes` for valid values |
| params?.bssid | string | <sup>*(optional)*</sup> BSSID to connect to. If specified, restricts connection to this BSSID only. Defaults to the best available BSSID for the SSID |
| params?.frequency | integer | <sup>*(optional)*</sup> Frequency band: `1` - 2.4GHz, `2` - 5GHz. If specified, connects only to SSIDs on the given frequency band. Defaults to best available |
## *WiFiConnect [<sup>method</sup>](#head.Methods)*

Initiates request to connect to the specified SSID with the given passphrase. Passphrase can be `null` when the network security is `NONE`. By default, the security mode is decided based on the highest security mode provided by the SSID, but it can be explicitly overridden via the optional `params.security` parameter. Also when called with no arguments, this method attempts to connect to the saved SSID and password. See `AddToKnownSSIDs`.
Initiates request to connect to the specified SSID with the given passphrase. Passphrase can be `null` when the network security is `NONE`. The security mode is decided based on the highest security mode provided by the SSID. Also when called with no arguments, this method attempts to connect to the saved SSID and password. See `AddToKnownSSIDs`.
},
"GetPrimaryInterface": {
"summary": "Gets the primary/default network interface for the device. The active network interface is defined as the one that can make requests to the external network. Returns one of the supported interfaces as per `GetAvailableInterfaces`.",
"summary": "Gets the primary/default network interface for the device. The active network interface is defined as the one that can make requests to the external network. Returns one of the supported interfaces as per `GetAvailableInterfaces`. if no active network is available, it returns empty string.",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants