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;