diff --git a/LegacyPlugin_WiFiManagerAPIs.cpp b/LegacyPlugin_WiFiManagerAPIs.cpp index 79a19541..9b7ec736 100644 --- a/LegacyPlugin_WiFiManagerAPIs.cpp +++ b/LegacyPlugin_WiFiManagerAPIs.cpp @@ -285,7 +285,7 @@ namespace WPEFramework returnJson(rc); } - + uint32_t WiFiManager::connect(const JsonObject& parameters, JsonObject& response) { uint32_t rc = Core::ERROR_GENERAL; diff --git a/NetworkManagerGnomeWIFI.cpp b/NetworkManagerGnomeWIFI.cpp index d379a38a..1a587bfb 100644 --- a/NetworkManagerGnomeWIFI.cpp +++ b/NetworkManagerGnomeWIFI.cpp @@ -983,14 +983,30 @@ namespace WPEFramework NMDeviceState deviceState = nm_device_get_state(device); - if (enabled) { + if (enabled) + { NMLOG_DEBUG("Enabling interface..."); if (deviceState >= NM_DEVICE_STATE_DISCONNECTED) // already enabled + { + if(_instance != nullptr) + { + /* if already enabled no event form networkmanger */ + _instance->ReportInterfaceStateChange(Exchange::INetworkManager::INTERFACE_ADDED, interface); + } return true; - } else { + } + } + else + { NMLOG_DEBUG("Disabling interface..."); if (deviceState <= NM_DEVICE_STATE_UNMANAGED) // already disabled + { + if(_instance != nullptr) { + /* if already disabled no event form networkmanger */ + _instance->ReportInterfaceStateChange(Exchange::INetworkManager::INTERFACE_REMOVED, interface); + } return true; + } else if (deviceState > NM_DEVICE_STATE_DISCONNECTED) { nm_device_disconnect_async(device, nullptr, disconnectCb, this); wait(loop);