Skip to content

Commit

Permalink
record network iterator value
Browse files Browse the repository at this point in the history
  • Loading branch information
Kshitijjain21 committed Apr 16, 2024
1 parent ec34942 commit ba7ca94
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/platform/Linux/NetworkCommissioningDriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down
3 changes: 2 additions & 1 deletion src/platform/Linux/NetworkCommissioningWiFiDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -415,6 +415,7 @@ bool LinuxWiFiDriver::WiFiNetworkIterator::Next(Network & item)
item.connected = true;
}
}
networkIteratorIndex++;

return true;
}
Expand Down

0 comments on commit ba7ca94

Please sign in to comment.