Skip to content

Commit

Permalink
Correct ++i to i++ for esp8266
Browse files Browse the repository at this point in the history
  • Loading branch information
tyeth committed Dec 11, 2024
1 parent 5aa4a73 commit 4d4dea2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/network_interfaces/Wippersnapper_ESP8266.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "ESP8266WiFi.h"
#include "ESP8266WiFiMulti.h"
#include "Wippersnapper.h"
#include "Wippersnapper_Networking.h"

/* NOTE - Projects that require "Secure MQTT" (TLS/SSL) also require a new
* SSL certificate every year. If adding Secure MQTT to your ESP8266 project is
Expand Down Expand Up @@ -160,7 +161,7 @@ class Wippersnapper_ESP8266 : public Wippersnapper {
WiFiNetwork networks[WS_MAX_SORTED_NETWORKS];
uint8_t numSavedNetworks = 0;
// Store the scanned networks in the vector
for (int i = 0; i < n; ++i) {
for (int i = 0; i < n; i++) {
if (i < WS_MAX_SORTED_NETWORKS) {
strncpy(networks[i].ssid, WiFi.SSID(i).c_str(),
sizeof(networks[i].ssid));
Expand All @@ -182,7 +183,7 @@ class Wippersnapper_ESP8266 : public Wippersnapper {
std::sort(networks, networks + numSavedNetworks, compareByRSSI);

// Was the network within secrets.json found?
for (int i = 0; i < numSavedNetworks; ++i) {
for (int i = 0; i < numSavedNetworks; i++) {
if (strcmp(_ssid, networks[i].ssid) == 0) {
WS_DEBUG_PRINT("SSID (");
WS_DEBUG_PRINT(_ssid);
Expand All @@ -207,7 +208,7 @@ class Wippersnapper_ESP8266 : public Wippersnapper {
// User-set network not found, print scan results to serial console
WS_DEBUG_PRINTLN("ERROR: Your WiFi network was not found!");
WS_DEBUG_PRINTLN("WipperSnapper found these WiFi networks:");
for (uint8_t i = 0; i < n; ++i)
for (uint8_t i = 0; i < n; i++)
{
WS_DEBUG_PRINT(WiFi.SSID(i));
WS_DEBUG_PRINT(" (");
Expand Down

0 comments on commit 4d4dea2

Please sign in to comment.