From f6a67c166deb5b0527823dd2039e63283f40aa52 Mon Sep 17 00:00:00 2001 From: cmuhammedrafi Date: Thu, 28 Nov 2024 09:34:47 +0000 Subject: [PATCH] legacy wifi api changed --- LegacyPlugin_WiFiManagerAPIs.cpp | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/LegacyPlugin_WiFiManagerAPIs.cpp b/LegacyPlugin_WiFiManagerAPIs.cpp index 5dada6b2..79a19541 100644 --- a/LegacyPlugin_WiFiManagerAPIs.cpp +++ b/LegacyPlugin_WiFiManagerAPIs.cpp @@ -250,14 +250,32 @@ namespace WPEFramework { LOG_INPARAM(); uint32_t rc = Core::ERROR_GENERAL; - string ssid{}; - ssid = parameters["ssid"].String(); auto _nwmgr = m_service->QueryInterfaceByCallsign(NETWORK_MANAGER_CALLSIGN); - if (_nwmgr) + if(_nwmgr) { - rc = _nwmgr->RemoveKnownSSID(ssid); - _nwmgr->Release(); + std::string ssid = {}; + if (parameters.HasLabel("ssid")) + { + ssid = parameters["ssid"].String(); + rc = _nwmgr->RemoveKnownSSID(ssid); + } + else + { + ::WPEFramework::RPC::IIteratorType* _ssids{}; + rc = _nwmgr->GetKnownSSIDs(_ssids); + if (Core::ERROR_NONE == rc && _ssids != nullptr) + { + string _resultItem_{}; + while (_ssids->Next(_resultItem_) == true) { + /* remove all the ssid */ + rc = _nwmgr->RemoveKnownSSID(_resultItem_); + } + _ssids->Release(); + } + } + + _nwmgr->Release(); } else rc = Core::ERROR_UNAVAILABLE;