23
23
#include " ESP8266WiFi.h"
24
24
#include " ESP8266WiFiMulti.h"
25
25
#include " Wippersnapper.h"
26
+ #include " Wippersnapper_Networking.h"
26
27
27
28
/* NOTE - Projects that require "Secure MQTT" (TLS/SSL) also require a new
28
29
* SSL certificate every year. If adding Secure MQTT to your ESP8266 project is
@@ -160,7 +161,7 @@ class Wippersnapper_ESP8266 : public Wippersnapper {
160
161
WiFiNetwork networks[WS_MAX_SORTED_NETWORKS];
161
162
uint8_t numSavedNetworks = 0 ;
162
163
// Store the scanned networks in the vector
163
- for (int i = 0 ; i < n; ++i ) {
164
+ for (int i = 0 ; i < n; i++ ) {
164
165
if (i < WS_MAX_SORTED_NETWORKS) {
165
166
strncpy (networks[i].ssid , WiFi.SSID (i).c_str (),
166
167
sizeof (networks[i].ssid ));
@@ -182,7 +183,7 @@ class Wippersnapper_ESP8266 : public Wippersnapper {
182
183
std::sort (networks, networks + numSavedNetworks, compareByRSSI);
183
184
184
185
// Was the network within secrets.json found?
185
- for (int i = 0 ; i < numSavedNetworks; ++i ) {
186
+ for (int i = 0 ; i < numSavedNetworks; i++ ) {
186
187
if (strcmp (_ssid, networks[i].ssid ) == 0 ) {
187
188
WS_DEBUG_PRINT (" SSID (" );
188
189
WS_DEBUG_PRINT (_ssid);
@@ -207,7 +208,7 @@ class Wippersnapper_ESP8266 : public Wippersnapper {
207
208
// User-set network not found, print scan results to serial console
208
209
WS_DEBUG_PRINTLN (" ERROR: Your WiFi network was not found!" );
209
210
WS_DEBUG_PRINTLN (" WipperSnapper found these WiFi networks:" );
210
- for (uint8_t i = 0 ; i < n; ++i )
211
+ for (uint8_t i = 0 ; i < n; i++ )
211
212
{
212
213
WS_DEBUG_PRINT (WiFi.SSID (i));
213
214
WS_DEBUG_PRINT (" (" );
0 commit comments