mirror of https://github.com/arendst/Tasmota.git
parent
edc7cd5bc3
commit
5e89578403
|
@ -756,7 +756,6 @@ String IPForUrl(const IPAddress & ip)
|
|||
// IPv4 has always priority
|
||||
// Copy the value of the IP if pointer provided (optional)
|
||||
bool WifiGetIP(IPAddress *ip) {
|
||||
#ifdef USE_IPV6
|
||||
if ((uint32_t)WiFi.localIP() != 0) {
|
||||
if (ip != nullptr) { *ip = WiFi.localIP(); }
|
||||
return true;
|
||||
|
@ -765,18 +764,15 @@ bool WifiGetIP(IPAddress *ip) {
|
|||
if (ip != nullptr) { *ip = WiFi.softAPIP(); }
|
||||
return true;
|
||||
}
|
||||
#ifdef USE_IPV6
|
||||
IPAddress lip;
|
||||
if (WifiGetIPv6(&lip)) {
|
||||
if (ip != nullptr) { *ip = lip; }
|
||||
return true;
|
||||
}
|
||||
if (ip != nullptr) { *ip = IPAddress(); }
|
||||
return false;
|
||||
#else
|
||||
// IPv4 only
|
||||
if (ip != nullptr) { *ip = WiFi.localIP(); }
|
||||
return (uint32_t)WiFi.localIP() != 0;
|
||||
#endif // USE_IPV6
|
||||
return false;
|
||||
}
|
||||
|
||||
bool WifiHasIP(void) {
|
||||
|
|
Loading…
Reference in New Issue