Skip to content

Commit

Permalink
RDK-49931 - Refactor LNF Thunder Plugin to use NetworkManager Thunder…
Browse files Browse the repository at this point in the history
… 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 <[email protected]>
  • Loading branch information
Gururaaja E S R authored and Gururaaja E S R committed Aug 15, 2024
1 parent 1eaf950 commit 3efe99c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
2 changes: 2 additions & 0 deletions NetworkManager/INetworkManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ namespace WPEFramework
string m_clientCert;
string m_privateKey;
string m_privateKeyPasswd;
bool m_persistSSIDInfo;
};

struct EXTERNAL WiFiSSIDInfo {
Expand Down Expand Up @@ -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;
};
}
}
5 changes: 4 additions & 1 deletion NetworkManager/NetworkManagerJsonRpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions NetworkManager/NetworkManagerRDKProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 *)&param, sizeof(param));
Expand Down
4 changes: 3 additions & 1 deletion docs/api/NetworkManagerPlugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 | <sup>*(optional)*</sup> Option to save the SSID Information (default: true) |

### Result

Expand All @@ -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
}
}
```
Expand Down

0 comments on commit 3efe99c

Please sign in to comment.