Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
kuba2k2 authored Apr 8, 2024
1 parent 90fd91a commit 3e964aa
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions cores/beken-72xx/arduino/libraries/WiFi/WiFiEvents.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ static void wifiEventTask(void *arg) {
}

// There is a race condition, when we have an event about a successful
// connection but no SSID yet returned by BDK. Even a sinlge millisecond
// connection but no SSID yet returned by BDK. Even a single millisecond
// delay should prevent this from happening. It's better to waste a bit
// of time here than to lose a valid connection down the line.
static String waitForValidSSID(WiFiClass *pWiFi) {
Expand All @@ -38,10 +38,8 @@ static String waitForValidSSID(WiFiClass *pWiFi) {
result = pWiFi->SSID();

if (!result.length()) {
std::size_t i = 0;

for (; i < 10; ++i) {
// Dealy and query again.
for (std::size_t i = 0; i < 10; i++) {
// Delay and query again.
delay(1);
result = pWiFi->SSID();

Expand All @@ -55,7 +53,7 @@ static String waitForValidSSID(WiFiClass *pWiFi) {
}

if (!result.length()) {
LT_DM(WIFI, "Could not obtain a valid SSID after %u delays", i);
LT_WM(WIFI, "Could not obtain a valid SSID after %u delays", i);
}
}

Expand Down

0 comments on commit 3e964aa

Please sign in to comment.