diff --git a/NetworkManagerGnomeWIFI.cpp b/NetworkManagerGnomeWIFI.cpp index 3abe5384..4d665b91 100644 --- a/NetworkManagerGnomeWIFI.cpp +++ b/NetworkManagerGnomeWIFI.cpp @@ -236,7 +236,7 @@ namespace WPEFramework NMLOG_DEBUG("bitrate : %s kbit/s", wifiInfo.rate.c_str()); //TODO signal strenght to dBm wifiInfo.strength = std::string(nmUtils::convertPercentageToSignalStrengtStr(strength)); - NMLOG_DEBUG("sterngth: %s %%", wifiInfo.strength.c_str()); + NMLOG_DEBUG("sterngth: %s dbm", wifiInfo.strength.c_str()); wifiInfo.security = static_cast(nmUtils::wifiSecurityModeFromAp(flags, wpaFlags, rsnFlags)); NMLOG_DEBUG("security %s", nmUtils::getSecurityModeString(flags, wpaFlags, rsnFlags).c_str()); NMLOG_DEBUG("Mode: %s", mode == NM_802_11_MODE_ADHOC ? "Ad-Hoc": mode == NM_802_11_MODE_INFRA ? "Infrastructure": "Unknown"); @@ -286,7 +286,7 @@ namespace WPEFramework return true; } - static void wifiDisconnectCb(GObject *object, GAsyncResult *result, gpointer user_data) + static void disconnectCb(GObject *object, GAsyncResult *result, gpointer user_data) { NMDevice *device = NM_DEVICE(object); GError *error = NULL; @@ -320,7 +320,7 @@ namespace WPEFramework return true; } - nm_device_disconnect_async(wifiNMDevice, NULL, wifiDisconnectCb, this); + nm_device_disconnect_async(wifiNMDevice, NULL, disconnectCb, this); wait(loop); return isSuccess; } @@ -997,7 +997,7 @@ namespace WPEFramework { wifiManager *_wifiManager = static_cast(user_data); GError *error = nullptr; - NMLOG_DEBUG("Successfully cb called Managed property."); + if (!nm_client_dbus_set_property_finish(NM_CLIENT(object), result, &error)) { if (g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { g_error_free(error); @@ -1055,10 +1055,11 @@ namespace WPEFramework NMLOG_DEBUG("Disabling interface..."); if (deviceState <= NM_DEVICE_STATE_UNMANAGED) // already disabled return true; - // else if (deviceState > NM_DEVICE_STATE_DISCONNECTED) { - // //nm_device_disconnect_async(device, nullptr, disconnectCb, this); - // //wait(loop); - // } + else if (deviceState > NM_DEVICE_STATE_DISCONNECTED) { + nm_device_disconnect_async(device, nullptr, disconnectCb, this); + wait(loop); + sleep(1); // to remove the connection + } } const char *objectPath = nm_object_get_path(NM_OBJECT(device));