mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-21 10:26:06 +03:00
allow setting the host name of AP interface
This commit is contained in:
parent
6a329c0562
commit
36a4131f35
@ -582,6 +582,25 @@ int ESP8266WiFiClass::hostByName(const char* aHostname, IPAddress& aResult)
|
|||||||
return (aResult != 0) ? 1 : 0;
|
return (aResult != 0) ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String ESP8266WiFiClass::hostname(void) {
|
||||||
|
return String(wifi_station_get_hostname());
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ESP8266WiFiClass::hostname(char* aHostname) {
|
||||||
|
if(strlen(aHostname) > 32) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return wifi_station_set_hostname(aHostname);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ESP8266WiFiClass::hostname(const char* aHostname) {
|
||||||
|
return hostname((char*) aHostname);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ESP8266WiFiClass::hostname(String aHostname) {
|
||||||
|
return hostname((char*) aHostname.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
void ESP8266WiFiClass::beginSmartConfig()
|
void ESP8266WiFiClass::beginSmartConfig()
|
||||||
{
|
{
|
||||||
if (_smartConfigStarted)
|
if (_smartConfigStarted)
|
||||||
|
@ -300,6 +300,19 @@ public:
|
|||||||
*/
|
*/
|
||||||
int hostByName(const char* aHostname, IPAddress& aResult);
|
int hostByName(const char* aHostname, IPAddress& aResult);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Get ESP8266 station DHCP hostname
|
||||||
|
*/
|
||||||
|
String hostname(void);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Set ESP8266 station DHCP hostname
|
||||||
|
* hostname, max length:32
|
||||||
|
*/
|
||||||
|
bool hostname(char* aHostname);
|
||||||
|
bool hostname(const char* aHostname);
|
||||||
|
bool hostname(String aHostname);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Output WiFi settings to an object derived from Print interface (like Serial).
|
* Output WiFi settings to an object derived from Print interface (like Serial).
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user