Skip to content

Commit 071eeb8

Browse files
tfry-gitd-a-v
authored andcommitted
Allow to disable DHCP gateway offer when set up of AP. (#4421)
1 parent 02f54e8 commit 071eeb8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libraries/ESP8266WiFi/src/ESP8266WiFiAP.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ bool ESP8266WiFiAPClass::softAP(const String& ssid, const String& passphrase, in
192192
/**
193193
* Configure access point
194194
* @param local_ip access point IP
195-
* @param gateway gateway IP
195+
* @param gateway gateway IP (0.0.0.0 to disable)
196196
* @param subnet subnet mask
197197
*/
198198
bool ESP8266WiFiAPClass::softAPConfig(IPAddress local_ip, IPAddress gateway, IPAddress subnet) {
@@ -248,7 +248,7 @@ bool ESP8266WiFiAPClass::softAPConfig(IPAddress local_ip, IPAddress gateway, IPA
248248
ret = false;
249249
}
250250

251-
uint8 mode = 1;
251+
uint8 mode = info.gw.addr ? 1 : 0;
252252
if(!wifi_softap_set_dhcps_offer_option(OFFER_ROUTER, &mode)) {
253253
DEBUG_WIFI("[APConfig] wifi_softap_set_dhcps_offer_option failed!\n");
254254
ret = false;

0 commit comments

Comments
 (0)