diff --git a/LegacyPlugin_NetworkAPIs.cpp b/LegacyPlugin_NetworkAPIs.cpp index 64a6c04..1919c3b 100644 --- a/LegacyPlugin_NetworkAPIs.cpp +++ b/LegacyPlugin_NetworkAPIs.cpp @@ -1014,10 +1014,10 @@ const string CIDR_PREFIXES[CIDR_NETMASK_IP_LEN+1] = { { JsonObject legacyParams; - legacyParams["oldInterfaceName"] = getInterfaceNameToType(parameters["oldInterfaceName"].String()); - legacyParams["newInterfaceName"] = getInterfaceNameToType(parameters["newInterfaceName"].String()); + legacyParams["oldInterfaceName"] = getInterfaceNameToType(parameters["prevActiveInterface"].String()); + legacyParams["newInterfaceName"] = getInterfaceNameToType(parameters["currentActiveInterface"].String()); - m_defaultInterface = parameters["newInterfaceName"].String(); + m_defaultInterface = parameters["currentActiveInterface"].String(); string json; legacyParams.ToString(json); @@ -1032,7 +1032,7 @@ const string CIDR_PREFIXES[CIDR_NETMASK_IP_LEN+1] = { JsonObject legacyParams; legacyParams["interface"] = getInterfaceNameToType(parameters["interface"].String()); - if (parameters["isIPv6"].Boolean()) + if (parameters["ipversion"].String() == "IPv6") { legacyParams["ip6Address"] = parameters["ipaddress"]; } @@ -1049,8 +1049,8 @@ const string CIDR_PREFIXES[CIDR_NETMASK_IP_LEN+1] = { Notify("onIPAddressStatusChanged", legacyParams); - if ("ACQUIRED" == parameters["status"].String()) - m_defaultInterface = parameters["interface"].String(); + // if ("ACQUIRED" == parameters["status"].String()) + // m_defaultInterface = parameters["interface"].String(); return; } diff --git a/LegacyPlugin_WiFiManagerAPIs.cpp b/LegacyPlugin_WiFiManagerAPIs.cpp index ba0c642..5dada6b 100644 --- a/LegacyPlugin_WiFiManagerAPIs.cpp +++ b/LegacyPlugin_WiFiManagerAPIs.cpp @@ -697,7 +697,7 @@ namespace WPEFramework } } else - NMLOG_WARNING("Ignoring %s\n", __FUNCTION__); + NMLOG_WARNING("Ignoring %s", __FUNCTION__); return; } @@ -710,7 +710,7 @@ namespace WPEFramework if(_gWiFiInstance) _gWiFiInstance->Notify("onAvailableSSIDs", parameters); else - NMLOG_WARNING("Ignoring %s\n", __FUNCTION__); + NMLOG_WARNING("Ignoring %s", __FUNCTION__); return; } @@ -718,8 +718,8 @@ namespace WPEFramework void WiFiManager::onWiFiSignalStrengthChange(const JsonObject& parameters) { JsonObject legacyParams; - legacyParams["signalStrength"] = parameters["signalQuality"]; - legacyParams["strength"] = parameters["signalLevel"]; + legacyParams["signalStrength"] = parameters["strength"]; + legacyParams["strength"] = parameters["quality"]; string json; legacyParams.ToString(json); @@ -727,7 +727,7 @@ namespace WPEFramework if (_gWiFiInstance) _gWiFiInstance->Notify("onWifiSignalThresholdChanged", legacyParams); else - NMLOG_WARNING("Ignoring %s\n", __FUNCTION__); + NMLOG_WARNING("Ignoring %s", __FUNCTION__); return; } diff --git a/WiFiSignalStrengthMonitor.cpp b/WiFiSignalStrengthMonitor.cpp index 27243b3..32aaa4c 100644 --- a/WiFiSignalStrengthMonitor.cpp +++ b/WiFiSignalStrengthMonitor.cpp @@ -54,8 +54,8 @@ namespace WPEFramework ssid = retrieveValues(ssid_command, "ssid", buff, sizeof (buff)); if (ssid.empty()) { - NMLOG_ERROR("ssid is empty"); quality = Exchange::INetworkManager::WIFI_SIGNAL_DISCONNECTED; + strengthOut = "0.00"; return; } @@ -71,6 +71,7 @@ namespace WPEFramework if (signalStrengthOut == 0.0f) { quality = Exchange::INetworkManager::WIFI_SIGNAL_DISCONNECTED; + strengthOut = "0.00"; } else if (signalStrengthOut >= signalStrengthThresholdExcellent && signalStrengthOut < 0) { @@ -100,14 +101,12 @@ namespace WPEFramework isRunning = true; monitorThread = std::thread(&WiFiSignalStrengthMonitor::monitorThreadFunction, this, interval); monitorThread.detach(); - std::thread::id threadId = monitorThread.get_id(); - NMLOG_INFO("Thread started with interval: %d seconds", interval); } void WiFiSignalStrengthMonitor::monitorThreadFunction(int interval) { static Exchange::INetworkManager::WiFiSignalQuality oldSignalQuality = Exchange::INetworkManager::WIFI_SIGNAL_DISCONNECTED; - NMLOG_INFO("WiFiSignalStrengthMonitor thread started !"); + NMLOG_INFO("WiFiSignalStrengthMonitor thread started ! (%d)", interval); while (!stopThread) { string ssid = "";