RDKEMW-22842: onWiFiStateChange Event to Include Wi-Fi Profile Info - #332
Closed
me-ha-p wants to merge 1 commit into
Closed
RDKEMW-22842: onWiFiStateChange Event to Include Wi-Fi Profile Info#332me-ha-p wants to merge 1 commit into
me-ha-p wants to merge 1 commit into
Conversation
…ation Reason for change: onWiFiStateChange event currently reports only the Wi-Fi connection state. Enhance onWiFiStateChange event payload to include the connected or affected Wi-Fi SSID. Priority: P1 Test Procedure: Refer ticket Risks: Low Signed-off-by: Mehavarshni_Palaniswamy@comcast.com
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the NetworkManager plugin’s onWiFiStateChange notification/event payload to include Wi-Fi profile information (SSID), updating the C++ notification interface, the plugin’s event dispatch path, and the public JSON-RPC documentation/schema accordingly.
Changes:
- Adds an
ssidfield to theonWiFiStateChangeJSON-RPC event payload. - Extends the
Exchange::INetworkManager::INotification::onWiFiStateChangecallback signature to carry the SSID through the internal notification pipeline. - Updates the public docs (
docs/) and JSON schema (definition/) to describe the newssidfield.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| plugin/NetworkManagerJsonRpc.cpp | Adds ssid to the emitted onWiFiStateChange JSON-RPC event parameters. |
| plugin/NetworkManagerImplementation.h | Extends internal event data struct to carry SSID alongside WiFiState. |
| plugin/NetworkManagerImplementation.cpp | Publishes SSID via the notification callbacks and attempts to track a “last known” SSID. |
| plugin/NetworkManager.h | Updates the notification adapter to forward (state, ssid) to the JSON-RPC layer. |
| interface/INetworkManager.h | Changes the notification interface signature to include SSID. |
| docs/NetworkManagerPlugin.md | Documents the new params.ssid field in the event payload. |
| definition/NetworkManager.json | Adds ssid to the event schema properties (not required). |
Suppressed comments (1)
plugin/NetworkManagerImplementation.cpp:1381
- lastKnownSSID is published for every WiFiState, including WIFI_STATE_CONNECTING and various failure states. Since lastKnownSSID is only updated on WIFI_STATE_CONNECTED, this can misreport a previous SSID as the one “causing” the current transition. Consider publishing lastKnownSSID only for states where it is actually relevant (e.g., CONNECTED/DISCONNECTED/connection-lost), and otherwise send an empty string.
WiFiStateChangeData eventData{state, lastKnownSSID};
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+1363
to
+1365
| Exchange::INetworkManager::WiFiSSIDInfo ssidInfo{}; | ||
| if ((GetConnectedSSID(ssidInfo) == Core::ERROR_NONE) && !ssidInfo.ssid.empty()) | ||
| lastKnownSSID = ssidInfo.ssid; |
Comment on lines
287
to
291
| // WiFi Notifications that other processes can subscribe to | ||
| virtual void onAvailableSSIDs(const string jsonOfScanResults /* @in */){}; | ||
| virtual void onWiFiStateChange(const WiFiState state /* @in */){}; | ||
| virtual void onWiFiStateChange(const WiFiState state /* @in */, const string ssid /* @in */){}; | ||
| virtual void onWiFiSignalQualityChange(const string ssid /* @in */, const int strength /* @in */, const int noise /* @in */, const int snr /* @in */, const WiFiSignalQuality quality /* @in */){}; | ||
| }; |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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: onWiFiStateChange event currently reports only the Wi-Fi connection state.
Enhance onWiFiStateChange event payload to include the connected or affected Wi-Fi SSID.
Priority: P1
Test Procedure: Refer ticket RDKEMW-23159
Risks: Low
Signed-off-by: Mehavarshni_Palaniswamy@comcast.com