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"); AC_DBG("DHCP client(%s)\n", wifi_station_dhcpc_status() == DHCP_STOPPED ? "STOPPED" : "STARTED");
#endif #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 // If the portal is requested promptly skip the first WiFi.begin and
// immediately start the portal. // immediately start the portal.
if (_apConfig.immediateStart) { if (_apConfig.immediateStart) {

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

Loading…
Cancel
Save