File tree 3 files changed +9
-13
lines changed
hardware/esp8266com/esp8266/libraries
ESP8266mDNS/examples/OTA-mDNS-SPIFFS
3 files changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -370,18 +370,18 @@ IPAddress ESP8266WiFiClass::gatewayIP()
370
370
return IPAddress (ip.gw .addr );
371
371
}
372
372
373
- char * ESP8266WiFiClass::SSID ()
373
+ String ESP8266WiFiClass::SSID () const
374
374
{
375
375
static struct station_config conf;
376
376
wifi_station_get_config (&conf);
377
- return reinterpret_cast <char *>(conf.ssid );
377
+ return String ( reinterpret_cast <char *>(conf.ssid ) );
378
378
}
379
379
380
- const char * ESP8266WiFiClass::psk ()
380
+ String ESP8266WiFiClass::psk () const
381
381
{
382
382
static struct station_config conf;
383
383
wifi_station_get_config (&conf);
384
- return reinterpret_cast <const char *>(conf.password );
384
+ return String ( reinterpret_cast <char *>(conf.password ) );
385
385
}
386
386
387
387
uint8_t * ESP8266WiFiClass::BSSID (void )
Original file line number Diff line number Diff line change @@ -173,21 +173,21 @@ class ESP8266WiFiClass
173
173
*
174
174
* return: ssid string
175
175
*/
176
- char * SSID ();
176
+ String SSID () const ;
177
177
178
178
/*
179
179
* Return the current pre shared key associated with the network
180
180
*
181
181
* return: psk string
182
182
*/
183
- const char * psk ();
183
+ String psk () const ;
184
184
185
185
/*
186
186
* Return the current bssid / mac associated with the network if configured
187
187
*
188
188
* return: bssid uint8_t *
189
189
*/
190
- uint8_t * BSSID (void );
190
+ uint8_t *BSSID (void );
191
191
192
192
/*
193
193
* Return the current bssid / mac associated with the network if configured
Original file line number Diff line number Diff line change @@ -240,12 +240,8 @@ void setup()
240
240
delay (10 );
241
241
}
242
242
243
- // ... Load sdk config.
244
- String ssid (WiFi.SSID ());
245
- String psk (WiFi.psk ());
246
-
247
- // ... Compare fiel config with sdk config.
248
- if (ssid != station_ssid || psk != station_psk)
243
+ // ... Compare file config with sdk config.
244
+ if (WiFi.SSID () != station_ssid || WiFi.psk () != station_psk)
249
245
{
250
246
Serial.println (" WiFi config changed." );
251
247
You can’t perform that action at this time.
0 commit comments