From 7f89102018a3b6750bfdd99391450f89046a4378 Mon Sep 17 00:00:00 2001 From: Gururaaja E S R Date: Thu, 15 Aug 2024 15:08:58 +0000 Subject: [PATCH] RDK-49931 - Refactor LNF Thunder Plugin to use NetworkManager Thunder Library Reason for change: Added saveSSIDDisabled parameter to WiFiConnect API of networkmanager Test Procedure: use curl command to check the functionality of LNF plugin Risks: Low Priority: P1 Signed-off-by: Gururaaja ESR --- NetworkManager/INetworkManager.h | 2 ++ NetworkManager/NetworkManagerJsonRpc.cpp | 5 ++++- NetworkManager/NetworkManagerRDKProxy.cpp | 2 ++ docs/api/NetworkManagerPlugin.md | 4 +++- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/NetworkManager/INetworkManager.h b/NetworkManager/INetworkManager.h index 4cb6beaad3..e63b045351 100644 --- a/NetworkManager/INetworkManager.h +++ b/NetworkManager/INetworkManager.h @@ -134,6 +134,7 @@ namespace WPEFramework string m_clientCert; string m_privateKey; string m_privateKeyPasswd; + bool m_saveSSIDDisabled; }; struct EXTERNAL WiFiSSIDInfo { @@ -297,6 +298,7 @@ namespace WPEFramework // Allow other processes to register/unregister from our notifications virtual uint32_t Register(INetworkManager::INotification* notification) = 0; virtual uint32_t Unregister(INetworkManager::INotification* notification) = 0; + bool m_defaultsaveSSIDDisabled = false; }; } } diff --git a/NetworkManager/NetworkManagerJsonRpc.cpp b/NetworkManager/NetworkManagerJsonRpc.cpp index 599aad34e1..422ce7a1ea 100644 --- a/NetworkManager/NetworkManagerJsonRpc.cpp +++ b/NetworkManager/NetworkManagerJsonRpc.cpp @@ -820,7 +820,10 @@ namespace WPEFramework ssid.m_privateKey = parameters["privateKey"].String(); if (parameters.HasLabel("privateKeyPasswd")) ssid.m_privateKeyPasswd = parameters["privateKeyPasswd"].String(); - + if (parameters.HasLabel("saveSSIDDisabled")) + ssid.m_saveSSIDDisabled = parameters["saveSSIDDisabled"].Boolean(); + else + ssid.m_saveSSIDDisabled = _NetworkManager->m_defaultsaveSSIDDisabled; if (_NetworkManager) rc = _NetworkManager->WiFiConnect(ssid); else diff --git a/NetworkManager/NetworkManagerRDKProxy.cpp b/NetworkManager/NetworkManagerRDKProxy.cpp index 5dcfd3afdd..a239d29629 100644 --- a/NetworkManager/NetworkManagerRDKProxy.cpp +++ b/NetworkManager/NetworkManagerRDKProxy.cpp @@ -236,6 +236,7 @@ typedef struct _WiFiConnection char carootcert[MAX_FILE_PATH_LEN]; char clientcert[MAX_FILE_PATH_LEN]; char privatekey[MAX_FILE_PATH_LEN]; + bool saveSSIDDisabled; } WiFiConnection; typedef struct _WiFiConnectedSSIDInfo @@ -1131,6 +1132,7 @@ const string CIDR_PREFIXES[CIDR_NETMASK_IP_LEN] = { ssid.m_clientCert.copy(param.data.connect.clientcert, sizeof(param.data.connect.clientcert) - 1); if(!ssid.m_privateKey.empty()) ssid.m_privateKey.copy(param.data.connect.privatekey, sizeof(param.data.connect.privatekey) - 1); + param.data.connect.saveSSIDDisabled = ssid.m_saveSSIDDisabled; } retVal = IARM_Bus_Call( IARM_BUS_NM_SRV_MGR_NAME, IARM_BUS_WIFI_MGR_API_connect, (void *)¶m, sizeof(param)); diff --git a/docs/api/NetworkManagerPlugin.md b/docs/api/NetworkManagerPlugin.md index 747a89a2d1..c64a451392 100644 --- a/docs/api/NetworkManagerPlugin.md +++ b/docs/api/NetworkManagerPlugin.md @@ -1353,6 +1353,7 @@ Initiates request to connect to the specified SSID with the given passphrase. Pa | params.ssid | string | The paired SSID | | params.passphrase | string | The access point password | | params.securityMode | integer | The security mode. See `getSupportedSecurityModes` | +| params.saveSSIDDisabled | boolean | To disable the save SSID option(default value : false) | ### Result @@ -1373,7 +1374,8 @@ Initiates request to connect to the specified SSID with the given passphrase. Pa "params": { "ssid": "123412341234", "passphrase": "password", - "securityMode": 6 + "securityMode": 6, + "saveSSIDDisabled": false } } ```