@@ -85,16 +85,19 @@ bool ESP8266WiFiAPClass::softAP(const char* ssid, const char* passphrase, int ch
8585
8686 if (!WiFi.enableAP (true )) {
8787 // enable AP failed
88+ DEBUG_WIFI (" [AP] enableAP failed!" );
8889 return false ;
8990 }
9091
9192 if (!ssid || *ssid == 0 || strlen (ssid) > 31 ) {
9293 // fail SSID too long or missing!
94+ DEBUG_WIFI (" [AP] SSID too long or missing!" );
9395 return false ;
9496 }
9597
9698 if (passphrase && (strlen (passphrase) > 63 || strlen (passphrase) < 8 )) {
9799 // fail passphrase to long or short!
100+ DEBUG_WIFI (" [AP] fail passphrase to long or short!" );
98101 return false ;
99102 }
100103
@@ -117,7 +120,7 @@ bool ESP8266WiFiAPClass::softAP(const char* ssid, const char* passphrase, int ch
117120 struct softap_config conf_current;
118121 wifi_softap_get_config (&conf_current);
119122 if (softap_config_equal (conf, conf_current)) {
120- DEBUGV ( " softap config unchanged" );
123+ DEBUG_WIFI ( " [AP] softap config unchanged" );
121124 return true ;
122125 }
123126
@@ -131,6 +134,9 @@ bool ESP8266WiFiAPClass::softAP(const char* ssid, const char* passphrase, int ch
131134 }
132135 ETS_UART_INTR_ENABLE ();
133136
137+ if (!ret) {
138+ DEBUG_WIFI (" [AP] set_config faild!" );
139+ }
134140 return ret;
135141}
136142
@@ -145,6 +151,7 @@ bool ESP8266WiFiAPClass::softAPConfig(IPAddress local_ip, IPAddress gateway, IPA
145151
146152 if (!WiFi.enableAP (true )) {
147153 // enable AP failed
154+ DEBUG_WIFI (" [AP] enableAP failed!" );
148155 return false ;
149156 }
150157
@@ -155,6 +162,8 @@ bool ESP8266WiFiAPClass::softAPConfig(IPAddress local_ip, IPAddress gateway, IPA
155162 wifi_softap_dhcps_stop ();
156163 if (wifi_set_ip_info (SOFTAP_IF, &info)) {
157164 return wifi_softap_dhcps_start ();
165+ } else {
166+ DEBUG_WIFI (" [AP] wifi_set_ip_info failed!" );
158167 }
159168 return false ;
160169}
0 commit comments