diff --git a/NetworkManager/INetworkManager.h b/NetworkManager/INetworkManager.h index 4cb6beaad3..3037acbf29 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_persistSSIDInfo; }; 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_defaultPersistSSIDInfo = true; }; } } diff --git a/NetworkManager/NetworkManagerJsonRpc.cpp b/NetworkManager/NetworkManagerJsonRpc.cpp index 599aad34e1..c28670487f 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("persistSSIDInfo")) + ssid.m_persistSSIDInfo = parameters["persistSSIDInfo"].Boolean(); + else + ssid.m_persistSSIDInfo = _NetworkManager->m_defaultPersistSSIDInfo; if (_NetworkManager) rc = _NetworkManager->WiFiConnect(ssid); else diff --git a/NetworkManager/NetworkManagerRDKProxy.cpp b/NetworkManager/NetworkManagerRDKProxy.cpp index 5dcfd3afdd..040e7e7232 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 persistSSIDInfo; } 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.persistSSIDInfo = ssid.m_persistSSIDInfo; } 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..b42c99253b 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.persistSSIDInfo | boolean | *(optional)* Option to save the SSID Information (default: true) | ### 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, + "persistSSIDInfo": true } } ```