Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
18 changes: 8 additions & 10 deletions plugin/gnome/NetworkManagerGnomeProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -766,19 +766,17 @@ namespace WPEFramework
std::list<string> ssidList;
if(wifi->getKnownSSIDs(ssidList))
{
if (!ssidList.empty())
{
ssids = Core::Service<RPC::StringIterator>::Create<RPC::IStringIterator>(ssidList);
if(ssids == nullptr) {
return Core::ERROR_GENERAL;
}
rc = Core::ERROR_NONE;
}
else
if (ssidList.empty())
{
NMLOG_INFO("known ssids not found !");
rc = Core::ERROR_GENERAL;
ssidList.push_back(string());
}
Comment thread
me-ha-p marked this conversation as resolved.

ssids = Core::Service<RPC::StringIterator>::Create<RPC::IStringIterator>(ssidList);
if(ssids == nullptr) {
return Core::ERROR_GENERAL;
}
rc = Core::ERROR_NONE;
}

return rc;
Expand Down
9 changes: 5 additions & 4 deletions plugin/rdk/NetworkManagerRDKProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ namespace WPEFramework
newObject["frequency"] = object["frequency"];
ssidsUpdated.Add(newObject);
}

::_instance->ReportAvailableSSIDs(ssidsUpdated);
break;
}
Expand Down Expand Up @@ -1040,14 +1041,14 @@ const string CIDR_PREFIXES[CIDR_NETMASK_IP_LEN+1] = {

memset(&param, 0, sizeof(param));

/* Must add new method to get all the known SSIDs but for now RDK-NM supports only one active SSID. So we repurpose this method */
retVal = IARM_Bus_Call(IARM_BUS_NM_SRV_MGR_NAME, IARM_BUS_WIFI_MGR_API_getConnectedSSID, (void *)&param, sizeof(param));
/* Must add new method to get all the known SSIDs but for now RDK-NM supports only one saved SSID. */
retVal = IARM_Bus_Call(IARM_BUS_NM_SRV_MGR_NAME, IARM_BUS_WIFI_MGR_API_getPairedSSID, (void *)&param, sizeof(param));

if(retVal == IARM_RESULT_SUCCESS)
{
auto &connectedSsid = param.data.getConnectedSSID;
auto &pairedSsid = param.data.getPairedSSID;
std::list<string> ssidList;
ssidList.push_back(string(connectedSsid.ssid));
ssidList.push_back(string(pairedSsid.ssid));
NMLOG_INFO ("GetKnownSSIDs Success");
Comment thread
me-ha-p marked this conversation as resolved.

ssids = Core::Service<RPC::StringIterator>::Create<RPC::IStringIterator>(ssidList);
Expand Down
1 change: 1 addition & 0 deletions plugin/rdk/NetworkManagerRDKProxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ typedef struct _IARM_Bus_WiFiSrvMgr_SsidList_Param_t {
#define IARM_BUS_WIFI_MGR_API_initiateWPSPairing2 "initiateWPSPairing2" /**< Initiate connection via WPS via either Push Button or PIN */
#define IARM_BUS_WIFI_MGR_API_cancelWPSPairing "cancelWPSPairing" /**< Cancel in-progress WPS */
#define IARM_BUS_WIFI_MGR_API_getConnectedSSID "getConnectedSSID" /**< Return properties of the currently connected SSID */
#define IARM_BUS_WIFI_MGR_API_getPairedSSID "getPairedSSID" /**< Return the saved SSID */
#define IARM_BUS_WIFI_MGR_API_saveSSID "saveSSID" /**< Save SSID and passphrase */
#define IARM_BUS_WIFI_MGR_API_clearSSID "clearSSID" /**< Clear given SSID */
#define IARM_BUS_WIFI_MGR_API_connect "connect" /**< Connect with given or saved SSID and passphrase */
Expand Down
7 changes: 3 additions & 4 deletions tests/l2Test/rdk/l2_test_rdkproxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -711,11 +711,10 @@ TEST_F(NetworkManagerTest, GetKnownSSIDs_Success)
{
IARM_Bus_WiFiSrvMgr_Param_t mockParam = {};
mockParam.status = true;
strncpy(mockParam.data.getConnectedSSID.ssid, "TestNetwork", SSID_SIZE - 1);
mockParam.data.getConnectedSSID.securityMode = NET_WIFI_SECURITY_WPA_WPA2_PSK;
strncpy(mockParam.data.getPairedSSID.ssid, "TestNetwork", SSID_SIZE - 1);

EXPECT_CALL(*p_iarmBusImplMock, IARM_Bus_Call(::testing::StrEq(IARM_BUS_NM_SRV_MGR_NAME),
::testing::StrEq(IARM_BUS_WIFI_MGR_API_getConnectedSSID),
::testing::StrEq(IARM_BUS_WIFI_MGR_API_getPairedSSID),
::testing::NotNull(), ::testing::_))
.WillOnce(::testing::DoAll(
::testing::Invoke([&mockParam](const char*, const char*, void* arg, size_t) {
Expand All @@ -731,7 +730,7 @@ TEST_F(NetworkManagerTest, GetKnownSSIDs_Success)
TEST_F(NetworkManagerTest, GetKnownSSIDs_Failed)
{
EXPECT_CALL(*p_iarmBusImplMock, IARM_Bus_Call(::testing::StrEq(IARM_BUS_NM_SRV_MGR_NAME),
::testing::StrEq(IARM_BUS_WIFI_MGR_API_getConnectedSSID),
::testing::StrEq(IARM_BUS_WIFI_MGR_API_getPairedSSID),
::testing::NotNull(), ::testing::_))
.WillOnce(::testing::Return(IARM_RESULT_IPCCORE_FAIL));

Expand Down
Loading