Add AutoConnectConfig::hostName

pull/41/head
Hieromon Ikasamo 6 years ago
parent 258fb32722
commit c48ecfff4a
  1. 4
      src/AutoConnect.cpp
  2. 4
      src/AutoConnect.h

@ -111,6 +111,10 @@ bool AutoConnect::begin(const char* ssid, const char* passphrase, unsigned long
AC_DBG("DHCP client(%s)\n", wifi_station_dhcpc_status() == DHCP_STOPPED ? "STOPPED" : "STARTED");
#endif
// Set host name
if (_apConfig.hostName.length())
WiFi.hostname(_apConfig.hostName.c_str());
// If the portal is requested promptly skip the first WiFi.begin and
// immediately start the portal.
if (_apConfig.immediateStart) {

@ -67,6 +67,7 @@ class AutoConnectConfig {
autoReset(true),
autoReconnect(false),
immediateStart(false),
hostName(String("")),
homeUri(AUTOCONNECT_HOMEURI),
staip(0U),
staGateway(0U),
@ -92,6 +93,7 @@ class AutoConnectConfig {
autoReset(true),
autoReconnect(false),
immediateStart(false),
hostName(String("")),
homeUri(AUTOCONNECT_HOMEURI),
staip(0U),
staGateway(0U),
@ -117,6 +119,7 @@ class AutoConnectConfig {
autoReset = o.autoReset;
autoReconnect = o.autoReconnect;
immediateStart = o.immediateStart;
hostName = o.hostName;
homeUri = o.homeUri;
staip = o.staip;
staGateway = o.staGateway;
@ -141,6 +144,7 @@ class AutoConnectConfig {
bool autoReset; /**< Reset ESP8266 module automatically when WLAN disconnected. */
bool autoReconnect; /**< Automatic reconnect with past SSID */
bool immediateStart; /**< Skips WiFi.begin(), start portal immediately */
String hostName; /**< host name */
String homeUri; /**< A URI of user site */
IPAddress staip; /**< Station static IP address */
IPAddress staGateway; /**< Station gateway address */

Loading…
Cancel
Save