Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
ad4928e
RDK-60453 [NW-Plugin]BSSID Improvements in Wifi Connection Processing…
cmuhammedrafi Mar 3, 2026
ecf6c0a
InetworkmanagerMock fix
cmuhammedrafi Mar 3, 2026
07efcc9
test case updated
cmuhammedrafi Mar 4, 2026
84b7e34
api name changed
cmuhammedrafi Mar 4, 2026
d2230b3
code cleanup
cmuhammedrafi Mar 5, 2026
4a6d69d
improved test coverage
cmuhammedrafi Mar 5, 2026
4eb7fe6
already connected check updated
cmuhammedrafi Mar 5, 2026
8610a71
error fix
cmuhammedrafi Mar 6, 2026
eea308b
unit test case updated
cmuhammedrafi Mar 6, 2026
a332956
update the review comments
cmuhammedrafi Mar 9, 2026
47b7a8d
Copilot review comments
cmuhammedrafi Mar 9, 2026
8e9bd41
review comment updated
cmuhammedrafi Mar 9, 2026
4e92b32
Merge branch 'develop' into topic/RDK-60454-Dev
cmuhammedrafi Mar 9, 2026
f9427da
doc updated
cmuhammedrafi Mar 9, 2026
f342812
update log line
cmuhammedrafi Mar 11, 2026
4bbda5a
specific object path null check added
cmuhammedrafi Mar 18, 2026
8394e2e
Merge branch 'develop' into topic/RDK-60454-Dev
cmuhammedrafi Mar 18, 2026
638ea20
copilot review comment updated
cmuhammedrafi Mar 18, 2026
63073e7
RDKEMW-15980: Adding breakpad support in networkmanager plugin
gururaajar Mar 24, 2026
4fc89f6
loglevel updated
cmuhammedrafi Mar 31, 2026
c729144
address sanitizer added
cmuhammedrafi Apr 1, 2026
2557fcd
add process monitor memmeory
cmuhammedrafi Apr 2, 2026
9b18c62
networkmanager asan linking
cmuhammedrafi Apr 2, 2026
4218b0e
wait debugg added
cmuhammedrafi Apr 2, 2026
44fa377
wificonnect scanning removed
cmuhammedrafi Apr 6, 2026
7c4fd3f
removed address sanitizer
cmuhammedrafi Apr 6, 2026
e11eb01
AP object path fix
cmuhammedrafi Apr 6, 2026
8ca99d9
gamilLoop getContext removed
cmuhammedrafi Apr 7, 2026
e83673f
unref m_connection
cmuhammedrafi Apr 8, 2026
6b6e049
more memmory leak fix
cmuhammedrafi Apr 8, 2026
47c331e
Revert "RDKEMW-15980: Adding breakpad support in networkmanager plugin"
cmuhammedrafi Apr 9, 2026
99b349d
updated review comments
cmuhammedrafi Apr 10, 2026
4fa0eca
create minimal eth connection update
cmuhammedrafi Apr 13, 2026
9744114
update workflow
cmuhammedrafi Apr 13, 2026
9ebf46c
Merge remote-tracking branch 'origin/develop' into topic/RDK-60454
cmuhammedrafi Apr 14, 2026
a9271c0
bssid print removed
cmuhammedrafi Apr 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 48 additions & 6 deletions definition/NetworkManager.json
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@
}
},
"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.",
"result": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -984,6 +984,36 @@
]
}
},
"ConnectToKnownSSID":{
"summary": "Connects to a saved SSID. The `ssid` parameter is mandatory. Returns failure if `ssid` is not specified or not found in the saved SSIDs list.",
"events":{
"onWiFiStateChange" : "Triggered when Wifi state changes to CONNECTING, CONNECTED .",
"onAddressChange" : "Triggered when an IP Address is assigned or lost",
"onInternetStatusChange" : "Triggered when internet connection state changed"
},
"params": {
"type": "object",
"properties": {
"ssid": {
"$ref": "#/definitions/ssid"
}
},
"required": [
"ssid"
]
},
"result": {
"type": "object",
"properties": {
"success":{
"$ref": "#/definitions/success"
}
},
"required": [
"success"
]
}
},
"WiFiConnect":{
"summary": "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`.",
"events":{
Expand All @@ -1003,6 +1033,16 @@
"type": "integer",
"example": 2
},
"bssid": {
"summary": "BSSID to connect to. If specified, restricts connection to this BSSID only. Defaults to the best available BSSID for the SSID.",
"type": "string",
"example": "00:11:22:33:44:55"
},
"frequency": {
"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",
Comment on lines +1042 to +1043
"example": 2
},
"ca_cert": {
"summary": "The ca_cert to be used for EAP",
"type": "string",
Expand Down Expand Up @@ -1053,11 +1093,7 @@
"type": "boolean",
"example": true
}
},
"required": [
"ssid",
"passphrase"
]
}
},
"result": {
"type": "object",
Expand Down Expand Up @@ -1469,6 +1505,11 @@
"type": "string",
"example": "myAP-2.4"
},
"bssid":{
"summary": "Discovered BSSID",
"type": "string",
"example": "00:11:22:33:44:55"
},
"security":{
"$ref": "#/definitions/security"
},
Expand All @@ -1481,6 +1522,7 @@
},
"required": [
"ssid",
"bssid",
"security",
"strength",
"frequency"
Expand Down
65 changes: 60 additions & 5 deletions docs/NetworkManagerPlugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ NetworkManager interface methods:
| [GetKnownSSIDs](#method.GetKnownSSIDs) | Gets list of saved SSIDs |
| [AddToKnownSSIDs](#method.AddToKnownSSIDs) | Saves the SSID, passphrase, and security mode for upcoming and future sessions |
| [RemoveKnownSSID](#method.RemoveKnownSSID) | Remove given SSID from saved SSIDs |
| [ConnectToKnownSSID](#method.ConnectToKnownSSID) | Connects to a saved SSID |
| [WiFiConnect](#method.WiFiConnect) | Initiates request to connect to the specified SSID with the given passphrase |
| [WiFiDisconnect](#method.WiFiDisconnect) | Disconnects from the currently connected SSID |
| [GetConnectedSSID](#method.GetConnectedSSID) | Returns the connected SSID information |
Expand Down Expand Up @@ -257,7 +258,7 @@ This method takes no parameters.
<a name="method.GetPrimaryInterface"></a>
## *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.

### Parameters

Expand Down Expand Up @@ -1238,10 +1239,58 @@ Also see: [onWiFiStateChange](#event.onWiFiStateChange), [onAddressChange](#even
}
```

<a name="method.ConnectToKnownSSID"></a>
## *ConnectToKnownSSID [<sup>method</sup>](#head.Methods)*

Connects to a saved SSID. The `ssid` parameter is mandatory. Returns failure if `ssid` is not specified or not found in the saved SSIDs list.

Also see: [onWiFiStateChange](#event.onWiFiStateChange), [onAddressChange](#event.onAddressChange), [onInternetStatusChange](#event.onInternetStatusChange)

### Parameters

| Name | Type | Description |
| :-------- | :-------- | :-------- |
| params | object | |
| params.ssid | string | The WiFi SSID Name |

### Result

| Name | Type | Description |
| :-------- | :-------- | :-------- |
| result | object | |
| result.success | boolean | Whether the request succeeded |

### Example

#### Request

```json
{
"jsonrpc": "2.0",
"id": 42,
"method": "org.rdk.NetworkManager.1.ConnectToKnownSSID",
"params": {
"ssid": "myHomeSSID"
}
}
```

#### Response

```json
{
"jsonrpc": "2.0",
"id": 42,
"result": {
"success": true
}
}
```

<a name="method.WiFiConnect"></a>
## *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`.

Also see: [onWiFiStateChange](#event.onWiFiStateChange)

Expand All @@ -1250,9 +1299,11 @@ Also see: [onWiFiStateChange](#event.onWiFiStateChange)
| Name | Type | Description |
| :-------- | :-------- | :-------- |
| params | object | |
| params.ssid | string | The WiFi SSID Name |
| params.passphrase | string | 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?.ssid | string | <sup>*(optional)*</sup> The WiFi SSID Name |
| 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 |
| params?.ca_cert | string | <sup>*(optional)*</sup> The ca_cert to be used for EAP |
| params?.client_cert | string | <sup>*(optional)*</sup> The client_cert to be used for EAP |
| params?.private_key | string | <sup>*(optional)*</sup> The private_key to be used for EAP |
Expand Down Expand Up @@ -1284,6 +1335,8 @@ Also see: [onWiFiStateChange](#event.onWiFiStateChange)
"ssid": "myHomeSSID",
"passphrase": "password",
"security": 2,
"bssid": "00:11:22:33:44:55",
"frequency": 2,
"ca_cert": "...",
"client_cert": "...",
"private_key": "...",
Expand Down Expand Up @@ -1873,6 +1926,7 @@ Triggered when scan completes or when scan cancelled.
| params.ssids | array | On Available SSID's |
| params.ssids[#] | object | |
| params.ssids[#].ssid | string | Discovered SSID |
| params.ssids[#].bssid | string | Discovered BSSID |
| params.ssids[#].security | integer | The security mode. See `GetSupportedSecurityModes` |
| params.ssids[#].strength | integer | The WiFi Signal RSSI value in dBm |
| params.ssids[#].frequency | number | The supported frequency for this SSID in GHz |
Expand All @@ -1887,6 +1941,7 @@ Triggered when scan completes or when scan cancelled.
"ssids": [
{
"ssid": "myAP-2.4",
"bssid": "00:11:22:33:44:55",
"security": 2,
"strength": -32,
"frequency": 2.442
Expand Down
11 changes: 11 additions & 0 deletions interface/INetworkManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,14 @@ namespace WPEFramework
WIFI_SECURITY_EAP /* @text: EAP */,
};

enum WIFIFrequency : uint8_t
{
WIFI_FREQUENCY_NONE /* @text: NONE */,
WIFI_FREQUENCY_2_4_GHZ /* @text: 2.4GHz */,
WIFI_FREQUENCY_5_GHZ /* @text: 5GHz */,
WIFI_FREQUENCY_6_GHZ /* @text: 6GHz */,
};

struct EXTERNAL WiFiScanResults {
string ssid;
WIFISecurityMode security;
Expand All @@ -113,6 +121,8 @@ namespace WPEFramework
struct EXTERNAL WiFiConnectTo {
string ssid;
string passphrase;
string bssid;
WIFIFrequency frequency;
Comment thread
cmuhammedrafi marked this conversation as resolved.
WIFISecurityMode security;
string ca_cert;
string client_cert;
Expand Down Expand Up @@ -244,6 +254,7 @@ namespace WPEFramework
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;

virtual uint32_t WiFiConnect(const WiFiConnectTo& ssid /* @in */) = 0;
virtual uint32_t WiFiDisconnect(void) = 0;
Expand Down
2 changes: 2 additions & 0 deletions plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ set_target_properties(${MODULE_NAME} PROPERTIES
CXX_STANDARD_REQUIRED YES
FRAMEWORK FALSE)


add_library(${MODULE_IMPL_NAME} SHARED
NetworkManagerImplementation.cpp
NetworkManagerConnectivity.cpp
Expand Down Expand Up @@ -135,6 +136,7 @@ target_link_libraries(${MODULE_IMPL_NAME} PRIVATE
${NAMESPACE}Plugins::${NAMESPACE}Plugins
)


target_link_libraries(${MODULE_IMPL_NAME} PRIVATE ${CURL_LIBRARIES})
target_include_directories(${MODULE_IMPL_NAME} PRIVATE ${CURL_INCLUDE_DIRS})

Expand Down
1 change: 1 addition & 0 deletions plugin/NetworkManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ namespace WPEFramework
uint32_t GetKnownSSIDs(const JsonObject& parameters, JsonObject& response);
uint32_t AddToKnownSSIDs(const JsonObject& parameters, JsonObject& response);
uint32_t RemoveKnownSSID(const JsonObject& parameters, JsonObject& response);
uint32_t ConnectToKnownSSID(const JsonObject& parameters, JsonObject& response);
uint32_t WiFiConnect(const JsonObject& parameters, JsonObject& response);
uint32_t WiFiDisconnect(const JsonObject& parameters, JsonObject& response);
uint32_t GetConnectedSSID(const JsonObject& parameters, JsonObject& response);
Expand Down
1 change: 1 addition & 0 deletions plugin/NetworkManagerImplementation.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ namespace WPEFramework
uint32_t GetKnownSSIDs(IStringIterator*& ssids /* @out */) override;
uint32_t AddToKnownSSIDs(const WiFiConnectTo& ssid /* @in */) override;
uint32_t RemoveKnownSSID(const string& ssid /* @in */) override;
uint32_t ConnectToKnownSSID(const string& ssid /* @in */) override;

uint32_t WiFiConnect(const WiFiConnectTo& ssid /* @in */) override;
uint32_t WiFiDisconnect(void) override;
Expand Down
40 changes: 39 additions & 1 deletion plugin/NetworkManagerJsonRpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ namespace WPEFramework
Register("GetKnownSSIDs", &NetworkManager::GetKnownSSIDs, this);
Register("AddToKnownSSIDs", &NetworkManager::AddToKnownSSIDs, this);
Register("RemoveKnownSSID", &NetworkManager::RemoveKnownSSID, this);
Register("ConnectToKnownSSID", &NetworkManager::ConnectToKnownSSID, this);
Register("WiFiConnect", &NetworkManager::WiFiConnect, this);
Register("WiFiDisconnect", &NetworkManager::WiFiDisconnect, this);
Register("GetConnectedSSID", &NetworkManager::GetConnectedSSID, this);
Expand Down Expand Up @@ -112,6 +113,7 @@ namespace WPEFramework
Unregister("GetKnownSSIDs");
Unregister("AddToKnownSSIDs");
Unregister("RemoveKnownSSID");
Unregister("ConnectToKnownSSID");
Unregister("WiFiConnect");
Unregister("WiFiDisconnect");
Unregister("GetConnectedSSID");
Expand Down Expand Up @@ -766,6 +768,29 @@ namespace WPEFramework
returnJson(rc);
}

uint32_t NetworkManager::ConnectToKnownSSID(const JsonObject& parameters, JsonObject& response)
{
LOG_INPARAM();
uint32_t rc = Core::ERROR_GENERAL;
string ssid{};

if (parameters.HasLabel("ssid"))
ssid = parameters["ssid"].String();

if (ssid.empty()) {
NMLOG_WARNING("ssid not provided or empty in ConnectToKnownSSID request!");
rc = Core::ERROR_BAD_REQUEST;
}
else if (_networkManager) {
rc = _networkManager->ConnectToKnownSSID(ssid);
}
else {
rc = Core::ERROR_UNAVAILABLE;
}

returnJson(rc);
}

uint32_t NetworkManager::WiFiConnect(const JsonObject& parameters, JsonObject& response)
{
uint32_t rc = Core::ERROR_GENERAL;
Expand All @@ -778,7 +803,20 @@ namespace WPEFramework

if (parameters.HasLabel("passphrase"))
ssid.passphrase = parameters["passphrase"].String();


if (parameters.HasLabel("bssid"))
ssid.bssid = parameters["bssid"].String();
if (parameters.HasLabel("frequency"))
{
int freq = parameters["frequency"].Number();
if (freq < 1 || freq > 3) {
NMLOG_WARNING("Invalid frequency value: %d (valid: 1=2.4GHz, 2=5GHz, 3=6GHz)", freq);
rc = Core::ERROR_BAD_REQUEST;
returnJson(rc);
}
ssid.frequency = static_cast <Exchange::INetworkManager::WIFIFrequency> (freq);
}
Comment thread
cmuhammedrafi marked this conversation as resolved.

if (parameters.HasLabel("security"))
ssid.security= static_cast <Exchange::INetworkManager::WIFISecurityMode> (parameters["security"].Number());

Expand Down
Loading
Loading