From c4a2780946beaa3386e1c51e2178d38e5039a169 Mon Sep 17 00:00:00 2001 From: Thomas Friedrichsmeier Date: Fri, 23 Feb 2018 14:47:58 +0100 Subject: [PATCH] Allow to disable DHCP gateway offer when set up of AP. --- libraries/ESP8266WiFi/src/ESP8266WiFiAP.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/ESP8266WiFi/src/ESP8266WiFiAP.cpp b/libraries/ESP8266WiFi/src/ESP8266WiFiAP.cpp index 6cf361b47e..6505ab943f 100644 --- a/libraries/ESP8266WiFi/src/ESP8266WiFiAP.cpp +++ b/libraries/ESP8266WiFi/src/ESP8266WiFiAP.cpp @@ -183,7 +183,7 @@ bool ESP8266WiFiAPClass::softAP(const char* ssid, const char* passphrase, int ch /** * Configure access point * @param local_ip access point IP - * @param gateway gateway IP + * @param gateway gateway IP (0.0.0.0 to disable) * @param subnet subnet mask */ bool ESP8266WiFiAPClass::softAPConfig(IPAddress local_ip, IPAddress gateway, IPAddress subnet) { @@ -230,7 +230,7 @@ bool ESP8266WiFiAPClass::softAPConfig(IPAddress local_ip, IPAddress gateway, IPA ret = false; } - uint8 mode = 1; + uint8 mode = info.gw.addr ? 1 : 0; if(!wifi_softap_set_dhcps_offer_option(OFFER_ROUTER, &mode)) { DEBUG_WIFI("[APConfig] wifi_softap_set_dhcps_offer_option failed!\n"); ret = false;