From ba7ca947f9923fdeda4b032685349cee0e7eb6ff Mon Sep 17 00:00:00 2001 From: Kshitij Jain Date: Mon, 25 Mar 2024 12:20:26 +0000 Subject: [PATCH] record network iterator value --- src/platform/Linux/NetworkCommissioningDriver.h | 1 + src/platform/Linux/NetworkCommissioningWiFiDriver.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/platform/Linux/NetworkCommissioningDriver.h b/src/platform/Linux/NetworkCommissioningDriver.h index 17efa150017ed9..b0bbea50a3afe8 100644 --- a/src/platform/Linux/NetworkCommissioningDriver.h +++ b/src/platform/Linux/NetworkCommissioningDriver.h @@ -74,6 +74,7 @@ class LinuxWiFiDriver final : public WiFiDriver private: LinuxWiFiDriver * driver; bool exhausted = false; + uint8_t networkIteratorIndex = 0; }; void Set5gSupport(bool is5gSupported) { mIs5gSupported = is5gSupported; } diff --git a/src/platform/Linux/NetworkCommissioningWiFiDriver.cpp b/src/platform/Linux/NetworkCommissioningWiFiDriver.cpp index b4d2bbaaeb5278..0621eecd4e09df 100644 --- a/src/platform/Linux/NetworkCommissioningWiFiDriver.cpp +++ b/src/platform/Linux/NetworkCommissioningWiFiDriver.cpp @@ -349,7 +349,7 @@ void LinuxWiFiDriver::ConnectNetwork(ByteSpan networkId, ConnectCallback * callb else #endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI_PDC { - ChipLogProgress(NetworkProvisioning, "LinuxWiFiDriver: ConnectNetwork '%.*s'", network.ssidLen, network.ssid); + ChipLogProgress(NetworkProvisioning, "LinuxWiFiDriver: ConnectNetwork '%.*s'", network[connectedNetworkIndex].ssidLen, network[connectedNetworkIndex].ssid); err = ConnectivityMgrImpl().ConnectWiFiNetworkAsync(ByteSpan(network[connectedNetworkIndex].ssid, network[connectedNetworkIndex].ssidLen), ByteSpan(network[connectedNetworkIndex].credentials, network[connectedNetworkIndex].credentialsLen), callback); @@ -415,6 +415,7 @@ bool LinuxWiFiDriver::WiFiNetworkIterator::Next(Network & item) item.connected = true; } } + networkIteratorIndex++; return true; }