diff --git a/config/nxp/chip-module/Kconfig b/config/nxp/chip-module/Kconfig index 7ee0917ebec555..88918a67450ad3 100644 --- a/config/nxp/chip-module/Kconfig +++ b/config/nxp/chip-module/Kconfig @@ -208,7 +208,7 @@ endif #CHIP_FACTORY_DATA_BUILD # See config/zephyr/Kconfig for full definition config CHIP_FACTORY_RESET_ERASE_NVS bool - default y + default y if CHIP_FACTORY_DATA || CHIP_FACTORY_DATA_CUSTOM_BACKEND endif diff --git a/config/nxp/chip-module/Kconfig.defaults b/config/nxp/chip-module/Kconfig.defaults index 531a3f38245aad..56c82e3752900c 100644 --- a/config/nxp/chip-module/Kconfig.defaults +++ b/config/nxp/chip-module/Kconfig.defaults @@ -87,7 +87,7 @@ config PTHREAD_IPC config POSIX_MAX_FDS int - default 8 + default 16 # Application stack size config MAIN_STACK_SIZE @@ -99,21 +99,12 @@ config INIT_STACKS config NET_MGMT_EVENT_STACK_SIZE default 2048 -config NET_MGMT_EVENT_QUEUE_SIZE - default 20 - config NET_IPV6_MLD default y config NET_IF_MCAST_IPV6_ADDR_COUNT default 14 -config NET_IF_MAX_IPV4_COUNT - default 2 - -config NET_IF_MAX_IPV6_COUNT - default 2 - config NET_TC_TX_COUNT default 1 @@ -138,10 +129,10 @@ config NET_TC_RX_THREAD_BASE_PRIO # Network buffers config NET_PKT_RX_COUNT - default 60 + default 16 config NET_PKT_TX_COUNT - default 40 + default 16 config NET_BUF_RX_COUNT default 60 @@ -150,7 +141,7 @@ config NET_BUF_TX_COUNT default 80 config NET_BUF_DATA_SIZE - default 1744 + default 1700 # Bluetooth Low Energy configs @@ -242,14 +233,11 @@ choice WPA_SUPP_LOG_LEVEL_CHOICE endchoice config WPA_SUPP_THREAD_STACK_SIZE - default 12288 + default 6144 config SYSTEM_WORKQUEUE_STACK_SIZE default 2048 -config NET_TCP_WORKQ_STACK_SIZE - default 2048 - # align these numbers to match the OpenThread config config NET_IF_UNICAST_IPV6_ADDR_COUNT default 6 @@ -258,25 +246,7 @@ config NET_IF_MCAST_IPV6_ADDR_COUNT default 8 config NET_SOCKETS_POLL_MAX - default 8 - -config NET_IPV4_FRAGMENT_MAX_COUNT - default 3 - -config NET_IPV4_FRAGMENT_MAX_PKT - default 7 - -config NET_IPV4_FRAGMENT_TIMEOUT - default 3 - -config NET_IPV6_FRAGMENT_MAX_COUNT - default 3 - -config NET_IPV6_FRAGMENT_MAX_PKT - default 7 - -config NET_IPV6_FRAGMENT_TIMEOUT - default 3 + default 4 # options managed by IP4/IP6 simultaneous support # aligned here to match OpenThread config @@ -290,7 +260,7 @@ config SHELL_STACK_SIZE default 2616 config HEAP_MEM_POOL_SIZE - default 122880 + default 65536 config CHIP_MALLOC_SYS_HEAP_SIZE default 28672 # 28 kB diff --git a/src/platform/nxp/zephyr/CHIPDevicePlatformConfig.h b/src/platform/nxp/zephyr/CHIPDevicePlatformConfig.h index 7a80a39a3f77b2..f8c72dd043902f 100644 --- a/src/platform/nxp/zephyr/CHIPDevicePlatformConfig.h +++ b/src/platform/nxp/zephyr/CHIPDevicePlatformConfig.h @@ -27,22 +27,65 @@ // ==================== Platform Adaptations ==================== -#define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID CONFIG_CHIP_DEVICE_VENDOR_ID -#define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_NAME CONFIG_CHIP_DEVICE_VENDOR_NAME -#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID CONFIG_CHIP_DEVICE_PRODUCT_ID -#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_NAME CONFIG_CHIP_DEVICE_PRODUCT_NAME -#define CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION CONFIG_CHIP_DEVICE_HARDWARE_VERSION -#define CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION_STRING CONFIG_CHIP_DEVICE_HARDWARE_VERSION_STRING -#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION CONFIG_CHIP_DEVICE_SOFTWARE_VERSION -#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING CONFIG_CHIP_DEVICE_SOFTWARE_VERSION_STRING -#define CHIP_DEVICE_CONFIG_TEST_MANUFACTURING_DATE CONFIG_CHIP_DEVICE_MANUFACTURING_DATE +#ifndef CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER #define CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER CONFIG_CHIP_DEVICE_SERIAL_NUMBER -#define CHIP_DEVICE_CONFIG_DEVICE_TYPE CONFIG_CHIP_DEVICE_TYPE -#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR CONFIG_CHIP_DEVICE_DISCRIMINATOR +#endif + +#ifndef CHIP_DEVICE_CONFIG_TEST_MANUFACTURING_DATE +#define CHIP_DEVICE_CONFIG_TEST_MANUFACTURING_DATE CONFIG_CHIP_DEVICE_MANUFACTURING_DATE +#endif + +#ifndef CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION +#define CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION CONFIG_CHIP_DEVICE_HARDWARE_VERSION +#endif + +#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE CONFIG_CHIP_DEVICE_SPAKE2_PASSCODE +#endif + +#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR +#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR CONFIG_CHIP_DEVICE_DISCRIMINATOR +#endif + +#ifndef CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION_STRING +#define CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION_STRING CONFIG_CHIP_DEVICE_HARDWARE_VERSION_STRING +#endif + +#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SPAKE2P_ITERATION_COUNT #define CHIP_DEVICE_CONFIG_USE_TEST_SPAKE2P_ITERATION_COUNT CONFIG_CHIP_DEVICE_SPAKE2_IT +#endif + +#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SPAKE2P_SALT #define CHIP_DEVICE_CONFIG_USE_TEST_SPAKE2P_SALT CONFIG_CHIP_DEVICE_SPAKE2_SALT +#endif + +#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SPAKE2P_VERIFIER #define CHIP_DEVICE_CONFIG_USE_TEST_SPAKE2P_VERIFIER CONFIG_CHIP_DEVICE_SPAKE2_TEST_VERIFIER +#endif + +#ifndef CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID +#define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID CONFIG_CHIP_DEVICE_VENDOR_ID +#endif + +#ifndef CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID +#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID CONFIG_CHIP_DEVICE_PRODUCT_ID +#endif + +#ifndef CHIP_DEVICE_CONFIG_DEVICE_VENDOR_NAME +#define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_NAME CONFIG_CHIP_DEVICE_VENDOR_NAME +#endif + +#ifndef CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_NAME +#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_NAME CONFIG_CHIP_DEVICE_PRODUCT_NAME +#endif + +#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION +#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION CONFIG_CHIP_DEVICE_SOFTWARE_VERSION +#endif + +#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING +#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING CONFIG_CHIP_DEVICE_SOFTWARE_VERSION_STRING +#endif #ifdef CONFIG_NET_L2_OPENTHREAD #define CHIP_DEVICE_CONFIG_ENABLE_THREAD CONFIG_NET_L2_OPENTHREAD @@ -50,8 +93,8 @@ #define CHIP_DEVICE_CONFIG_ENABLE_THREAD 0 #endif -#ifdef CONFIG_CHIP_WIFI -#define CHIP_DEVICE_CONFIG_ENABLE_WIFI CONFIG_CHIP_WIFI +#ifdef CONFIG_WIFI_NXP +#define CHIP_DEVICE_CONFIG_ENABLE_WIFI CONFIG_WIFI_NXP #define CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION 1 #define CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP 0 #else @@ -112,8 +155,6 @@ #define CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE 8192 #endif // CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE -#define CHIP_DEVICE_CONFIG_MAX_EVENT_QUEUE_SIZE 64 - #define CHIP_DEVICE_CONFIG_ENABLE_WIFI_TELEMETRY 0 #define CHIP_DEVICE_CONFIG_ENABLE_THREAD_TELEMETRY 0 #define CHIP_DEVICE_CONFIG_ENABLE_THREAD_TELEMETRY_FULL 0 @@ -156,6 +197,10 @@ #define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DEVICE_TYPE 1 #endif // CONFIG_CHIP_COMMISSIONABLE_DEVICE_TYPE +#ifdef CONFIG_CHIP_DEVICE_TYPE +#define CHIP_DEVICE_CONFIG_DEVICE_TYPE CONFIG_CHIP_DEVICE_TYPE +#endif // CONFIG_CHIP_DEVICE_TYPE + #ifdef CONFIG_CHIP_EXTENDED_DISCOVERY #define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 #endif // CONFIG_CHIP_EXTENDED_DISCOVERY diff --git a/src/platform/nxp/zephyr/SystemPlatformConfig.h b/src/platform/nxp/zephyr/SystemPlatformConfig.h index 1757071f42a751..24f8c4d229e235 100644 --- a/src/platform/nxp/zephyr/SystemPlatformConfig.h +++ b/src/platform/nxp/zephyr/SystemPlatformConfig.h @@ -25,5 +25,3 @@ #pragma once #include - -#define CHIP_SYSTEM_CONFIG_USE_ZEPHYR_SOCKET_EXTENSIONS 0 diff --git a/src/platform/nxp/zephyr/wifi/NxpWifiDriver.cpp b/src/platform/nxp/zephyr/wifi/NxpWifiDriver.cpp index f3969a583221e6..06a0b48f1e8c77 100644 --- a/src/platform/nxp/zephyr/wifi/NxpWifiDriver.cpp +++ b/src/platform/nxp/zephyr/wifi/NxpWifiDriver.cpp @@ -147,6 +147,10 @@ CHIP_ERROR NxpWifiDriver::CommitConfiguration() CHIP_ERROR NxpWifiDriver::RevertConfiguration() { + // Abort Connection Recovery if it is in progress during reverting configuration. + // This is needed to stop recovery process after failsafe timer expiring. + WiFiManager::Instance().AbortConnectionRecovery(); + LoadFromStorage(); if (WiFiManager::StationStatus::CONNECTING <= WiFiManager::Instance().GetStationStatus()) diff --git a/src/platform/nxp/zephyr/wifi/WiFiManager.cpp b/src/platform/nxp/zephyr/wifi/WiFiManager.cpp index 8b6fdf64bbe8d9..946546288761b4 100644 --- a/src/platform/nxp/zephyr/wifi/WiFiManager.cpp +++ b/src/platform/nxp/zephyr/wifi/WiFiManager.cpp @@ -142,8 +142,8 @@ const Map WiFiManager::sEventHandlerMap({ { NET_EVENT_WIFI_SCAN_RESULT, WiFiManager::ScanResultHandler }, { NET_EVENT_WIFI_SCAN_DONE, WiFiManager::ScanDoneHandler }, { NET_EVENT_WIFI_CONNECT_RESULT, WiFiManager::ConnectHandler }, - { NET_EVENT_WIFI_DISCONNECT_RESULT, WiFiManager::DisconnectHandler }, - { NET_EVENT_WIFI_DISCONNECT_COMPLETE, WiFiManager::DisconnectHandler } }); + { NET_EVENT_WIFI_DISCONNECT_RESULT, WiFiManager::NetworkDrivenDisconnectHandler }, + { NET_EVENT_WIFI_DISCONNECT_COMPLETE, WiFiManager::ApplicationDrivenDisconnectHandler } }); void WiFiManager::WifiMgmtEventHandler(net_mgmt_event_callback * cb, uint32_t mgmtEvent, net_if * iface) { @@ -206,6 +206,9 @@ CHIP_ERROR WiFiManager::Scan(const ByteSpan & ssid, ScanResultCallback resultCal mCachedWiFiState = mWiFiState; mWiFiState = WIFI_STATE_SCANNING; mSsidFound = false; + mRecoveryArmed = true; + // TODO Workaround for recovery mechanism to wait before the next scan request until the WiFi supplicant is not busy. + static bool workaroundDone; /* If the ssid is not null, it means the scan must target a specific SSID, and only include this one in the scan * result. To do so, we save the requested ssid and we will filter the scan results accordingly in the scan done @@ -217,9 +220,28 @@ CHIP_ERROR WiFiManager::Scan(const ByteSpan & ssid, ScanResultCallback resultCal mNetworkToScan.ssidLen = ssid.size(); } - if (0 != net_mgmt(NET_REQUEST_WIFI_SCAN, iface, NULL, 0)) + int ret = net_mgmt(NET_REQUEST_WIFI_SCAN, iface, NULL, 0); + + if (ret) { - ChipLogError(DeviceLayer, "Scan request failed"); + ChipLogError(DeviceLayer, "Scan request failed %d", ret); + if (ret == -EBUSY && !workaroundDone) + { + // TODO Wi-Fi driver returned an error during recovery. + // As a workaround schedule the recovery timer one more time in WifiSupplicantWorkaroundTime time. + // This allows the device to run the Scan method without + // rebooting when the "Device or resource busy" error occurs. + DeviceLayer::SystemLayer().StartTimer(System::Clock::Milliseconds32(kWifiSupplicantWorkaroundTime), Recover, nullptr); + workaroundDone = true; + return CHIP_NO_ERROR; + } + else + { + // TODO The workaround has not worked, so reboot the device + ChipLogError(DeviceLayer, "WiFi driver does not respond, resetting the device..."); + workaroundDone = false; + PlatformMgr().Shutdown(); + } return CHIP_ERROR_INTERNAL; } @@ -415,14 +437,21 @@ void WiFiManager::ScanDoneHandler(Platform::UniquePtr data) // Internal scan is supposed to be followed by a connection request if the SSID has been found if (Instance().mInternalScan) { - if (!Instance().mSsidFound) + if (Instance().mRecoveryArmed) { - ChipLogProgress(DeviceLayer, "No requested SSID found"); - auto currentTimeout = Instance().CalculateNextRecoveryTime(); - ChipLogProgress(DeviceLayer, "Starting connection recover: re-scanning... (next attempt in %d ms)", - currentTimeout.count()); - DeviceLayer::SystemLayer().StartTimer(currentTimeout, Recover, nullptr); - return; + if (!Instance().mSsidFound) + { + ChipLogProgress(DeviceLayer, "No requested SSID found"); + auto currentTimeout = Instance().CalculateNextRecoveryTime(); + ChipLogProgress(DeviceLayer, "Starting connection recover: re-scanning... (next attempt in %d ms)", + currentTimeout.count()); + DeviceLayer::SystemLayer().StartTimer(currentTimeout, Recover, nullptr); + return; + } + else + { + Instance().AbortConnectionRecovery(); + } } Instance().mWiFiState = WIFI_STATE_ASSOCIATING; @@ -513,6 +542,8 @@ void WiFiManager::ConnectHandler(Platform::UniquePtr data) ChipLogError(DeviceLayer, "Cannot post event [error: %s]", ErrorStr(error)); } } + // Ensure fresh recovery for future connection requests. + Instance().ResetRecoveryTime(); // cleanup the provisioning data as it is configured per each connect request Instance().ClearStationProvisioningData(); }); @@ -524,8 +555,16 @@ void WiFiManager::ConnectHandler(Platform::UniquePtr data) } } -void WiFiManager::DisconnectHandler(Platform::UniquePtr) +void WiFiManager::NetworkDrivenDisconnectHandler(Platform::UniquePtr) { + // Workaround: schedule the application level connection recovery in kSupplicantReconnectionTimeoutMs to give WPA supplicant + // some time to restore it. + if (!Instance().mRecoveryArmed) + { + Instance().mRecoveryArmed = true; + DeviceLayer::SystemLayer().StartTimer(System::Clock::Milliseconds32(kSupplicantReconnectionTimeoutMs), Recover, nullptr); + } + SystemLayer().ScheduleLambda([] { ChipLogProgress(DeviceLayer, "WiFi station disconnected"); Instance().mWiFiState = WIFI_STATE_DISCONNECTED; @@ -533,6 +572,24 @@ void WiFiManager::DisconnectHandler(Platform::UniquePtr) }); } +void WiFiManager::ApplicationDrivenDisconnectHandler(Platform::UniquePtr) +{ + if (!Instance().mRecoveryArmed) + { + return; + } + + if (!Instance().mApplicationDisconnectRequested) + { + Instance().AbortConnectionRecovery(); + } + else + { + Instance().mApplicationDisconnectRequested = false; + SystemLayer().ScheduleLambda([] { Recover(nullptr, nullptr); }); + } +} + WiFiManager::StationStatus WiFiManager::GetStationStatus() const { return WiFiManager::sStatusMap[mWiFiState]; @@ -546,6 +603,23 @@ void WiFiManager::PostConnectivityStatusChange(ConnectivityChange changeType) PlatformMgr().PostEventOrDie(&networkEvent); } +System::Clock::Milliseconds32 WiFiManager::CalculateNextRecoveryTime() +{ + if (mConnectionRecoveryTimeMs > kConnectionRecoveryMaxIntervalMs) + { + // Find the new random jitter value in range [-jitter, +jitter]. + int32_t jitter = chip::Crypto::GetRandU32() % (2 * jitter + 1) - jitter; + mConnectionRecoveryTimeMs = kConnectionRecoveryMaxIntervalMs + jitter; + return System::Clock::Milliseconds32(mConnectionRecoveryTimeMs); + } + else + { + uint32_t currentRecoveryTimeout = mConnectionRecoveryTimeMs; + mConnectionRecoveryTimeMs = mConnectionRecoveryTimeMs * 2; + return System::Clock::Milliseconds32(currentRecoveryTimeout); + } +} + void WiFiManager::Recover(System::Layer *, void *) { // Prevent scheduling recovery if we are already connected to the network. @@ -575,23 +649,7 @@ void WiFiManager::AbortConnectionRecovery() { DeviceLayer::SystemLayer().CancelTimer(Recover, nullptr); Instance().ResetRecoveryTime(); -} - -System::Clock::Milliseconds32 WiFiManager::CalculateNextRecoveryTime() -{ - if (mConnectionRecoveryTimeMs > kConnectionRecoveryMaxIntervalMs) - { - // Find the new random jitter value in range [-jitter, +jitter]. - int32_t jitter = chip::Crypto::GetRandU32() % (2 * jitter + 1) - jitter; - mConnectionRecoveryTimeMs = kConnectionRecoveryMaxIntervalMs + jitter; - return System::Clock::Milliseconds32(mConnectionRecoveryTimeMs); - } - else - { - uint32_t currentRecoveryTimeout = mConnectionRecoveryTimeMs; - mConnectionRecoveryTimeMs = mConnectionRecoveryTimeMs * 2; - return System::Clock::Milliseconds32(currentRecoveryTimeout); - } + Instance().mRecoveryArmed = false; } CHIP_ERROR WiFiManager::SetLowPowerMode(bool onoff) diff --git a/src/platform/nxp/zephyr/wifi/WiFiManager.h b/src/platform/nxp/zephyr/wifi/WiFiManager.h index d48536fb3d0da3..29f2ef299af1aa 100644 --- a/src/platform/nxp/zephyr/wifi/WiFiManager.h +++ b/src/platform/nxp/zephyr/wifi/WiFiManager.h @@ -173,6 +173,10 @@ class WiFiManager static constexpr uint32_t kConnectionRecoveryMaxIntervalMs = CONFIG_CHIP_WIFI_CONNECTION_RECOVERY_MAXIMUM_INTERVAL; static constexpr uint32_t kConnectionRecoveryJitterMs = CONFIG_CHIP_WIFI_CONNECTION_RECOVERY_JITTER; static constexpr uint32_t kConnectionRecoveryMaxRetries = CONFIG_CHIP_WIFI_CONNECTION_RECOVERY_MAX_RETRIES_NUMBER; + static constexpr uint32_t kSupplicantReconnectionTimeoutMs = 60000; + + static_assert(kConnectionRecoveryMinIntervalMs < kConnectionRecoveryMaxIntervalMs); + static_assert(kConnectionRecoveryJitterMs <= kConnectionRecoveryMaxIntervalMs); CHIP_ERROR Init(); CHIP_ERROR Scan(const ByteSpan & ssid, ScanResultCallback resultCallback, ScanDoneCallback doneCallback, @@ -196,14 +200,16 @@ class WiFiManager }; constexpr static uint32_t kWifiManagementEvents = NET_EVENT_WIFI_SCAN_RESULT | NET_EVENT_WIFI_SCAN_DONE | - NET_EVENT_WIFI_CONNECT_RESULT | NET_EVENT_WIFI_DISCONNECT_RESULT | NET_EVENT_WIFI_IFACE_STATUS; + NET_EVENT_WIFI_CONNECT_RESULT | NET_EVENT_WIFI_DISCONNECT_RESULT | NET_EVENT_WIFI_DISCONNECT_COMPLETE | + NET_EVENT_WIFI_IFACE_STATUS; // Event handling static void WifiMgmtEventHandler(net_mgmt_event_callback * cb, uint32_t mgmtEvent, net_if * iface); static void ScanResultHandler(Platform::UniquePtr data); static void ScanDoneHandler(Platform::UniquePtr data); static void ConnectHandler(Platform::UniquePtr data); - static void DisconnectHandler(Platform::UniquePtr data); + static void NetworkDrivenDisconnectHandler(Platform::UniquePtr data); + static void ApplicationDrivenDisconnectHandler(Platform::UniquePtr data); static void PostConnectivityStatusChange(ConnectivityChange changeType); static void SendRouterSolicitation(System::Layer * layer, void * param); @@ -234,7 +240,10 @@ class WiFiManager bool mSsidFound{ false }; uint32_t mConnectionRecoveryCounter{ 0 }; uint32_t mConnectionRecoveryTimeMs{ kConnectionRecoveryMinIntervalMs }; + bool mRecoveryArmed{ false }; bool mApplicationDisconnectRequested{ false }; + // TODO Workaround for recovery mechanism to wait before the next scan request until the WiFi supplicant is not busy. + static constexpr uint32_t kWifiSupplicantWorkaroundTime = 8000; static const Map sStatusMap; static const Map sEventHandlerMap;