Skip to content

Commit 60326f3

Browse files
author
Luc
committed
Code refactoring + indentation
Thanks @treepleks
1 parent 326ef1c commit 60326f3

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

esp8266/webinterface.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ class WEBINTERFACE_CLASS
6464
bool AddAuthIP(auth_ip * item);
6565
bool ResetAuthIP(IPAddress ip,const char * sessionID);
6666
uint8_t _upload_status;
67+
6768
private:
6869
auth_ip * _head;
6970
uint8_t _nb_ip;
70-
7171
};
7272

7373
extern WEBINTERFACE_CLASS * web_interface;

esp8266/wifi.cpp

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ byte WIFI_CONFIG::split_ip (const char * ptr,byte * part)
7272
part[3]=0;
7373
return 0;
7474
}
75+
7576
char pstart [16];
7677
char * ptr2;
7778
strcpy(pstart,ptr);
@@ -122,6 +123,7 @@ void WIFI_CONFIG::Safe_Setup()
122123
dnsServer.stop();
123124
delay(100);
124125
#endif
126+
125127
WiFi.disconnect();
126128
//setup Soft AP
127129
WiFi.mode(WIFI_AP);
@@ -146,6 +148,7 @@ bool WIFI_CONFIG::Setup()
146148
int wstatus;
147149
IPAddress currentIP;
148150
byte bflag=0;
151+
149152
//set the sleep mode
150153
if (!CONFIG::read_byte(EP_SLEEP_MODE, &bflag ))
151154
{
@@ -208,11 +211,19 @@ bool WIFI_CONFIG::Setup()
208211
while (WiFi.status() != WL_CONNECTED && i<40) {
209212
switch(WiFi.status())
210213
{
211-
case 1:Serial.println(F("M117 No SSID found!"));
214+
case 1:
215+
Serial.print(FPSTR(M117_));
216+
Serial.println(F("No SSID found!"));
212217
break;
213-
case 4:Serial.println(F("M117 No Connection!"));
218+
219+
case 4:
220+
Serial.print(FPSTR(M117_));
221+
Serial.println(F("No Connection!"));
214222
break;
215-
default: Serial.println(F("M117 Connecting..."));
223+
224+
default:
225+
Serial.print(FPSTR(M117_));
226+
Serial.println(F("Connecting..."));
216227
break;
217228
}
218229
delay(500);
@@ -221,6 +232,7 @@ bool WIFI_CONFIG::Setup()
221232
if (WiFi.status() != WL_CONNECTED) return false;
222233
WiFi.hostname(hostname);
223234
}
235+
224236
//DHCP or Static IP ?
225237
if (!CONFIG::read_byte(EP_IP_MODE, &bflag )) return false;
226238
if (bflag==STATIC_IP_MODE)
@@ -242,7 +254,8 @@ bool WIFI_CONFIG::Setup()
242254
#ifdef MDNS_FEATURE
243255
// Set up mDNS responder:
244256
if (!mdns.begin(hostname)) {
245-
Serial.println(F("M117 Error with mDNS!"));
257+
Serial.print(FPSTR(M117_));
258+
Serial.println(F("Error with mDNS!"));
246259
delay(1000);
247260
}
248261
#endif

esp8266/wifi.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ class WIFI_CONFIG
5050
const char * get_hostname();
5151
private:
5252
char _hostname[33];
53-
5453
};
5554

5655
extern WIFI_CONFIG wifi_config;

0 commit comments

Comments
 (0)