diff --git a/docs/en/api/wifi.rst b/docs/en/api/wifi.rst index 010a11cfc1c..d18ac273686 100644 --- a/docs/en/api/wifi.rst +++ b/docs/en/api/wifi.rst @@ -345,7 +345,7 @@ Function to get the IPv6 address. .. code-block:: arduino - IPAddress softAPIPv6(); + IPAddress softAPlinkLocalIPv6(); The function will return the AP IPv6 address in ``IPAddress`` format. diff --git a/libraries/Networking/src/ESP_Network_Interface.cpp b/libraries/Networking/src/ESP_Network_Interface.cpp index 73d87ab0df3..0169511080f 100644 --- a/libraries/Networking/src/ESP_Network_Interface.cpp +++ b/libraries/Networking/src/ESP_Network_Interface.cpp @@ -284,7 +284,7 @@ bool ESP_Network_Interface::hasIP() const { return (getStatusBits() & ESP_NETIF_HAS_IP_BIT) != 0; } -bool ESP_Network_Interface::hasLocalIPv6() const { +bool ESP_Network_Interface::hasLinkLocalIPv6() const { return (getStatusBits() & ESP_NETIF_HAS_LOCAL_IP6_BIT) != 0; } @@ -645,7 +645,7 @@ uint8_t ESP_Network_Interface::subnetCIDR() const return calculateSubnetCIDR(IPAddress(ip.netmask.addr)); } -IPAddress ESP_Network_Interface::localIPv6() const +IPAddress ESP_Network_Interface::linkLocalIPv6() const { if(_esp_netif == NULL){ return IPAddress(IPv6); diff --git a/libraries/Networking/src/ESP_Network_Interface.h b/libraries/Networking/src/ESP_Network_Interface.h index 6226ee573c6..011020d2f23 100644 --- a/libraries/Networking/src/ESP_Network_Interface.h +++ b/libraries/Networking/src/ESP_Network_Interface.h @@ -45,7 +45,7 @@ class ESP_Network_Interface: public Printable { bool started() const; bool connected() const; bool hasIP() const; - bool hasLocalIPv6() const; + bool hasLinkLocalIPv6() const; bool hasGlobalIPv6() const; bool enableIPv6(bool en=true); @@ -63,7 +63,7 @@ class ESP_Network_Interface: public Printable { IPAddress broadcastIP() const; IPAddress networkID() const; uint8_t subnetCIDR() const; - IPAddress localIPv6() const; + IPAddress linkLocalIPv6() const; IPAddress globalIPv6() const; size_t printTo(Print & out) const; diff --git a/libraries/WiFi/examples/WiFiBlueToothSwitch/WiFiBlueToothSwitch.ino b/libraries/WiFi/examples/WiFiBlueToothSwitch/WiFiBlueToothSwitch.ino index be9aa239627..dacb891a4f3 100644 --- a/libraries/WiFi/examples/WiFiBlueToothSwitch/WiFiBlueToothSwitch.ino +++ b/libraries/WiFi/examples/WiFiBlueToothSwitch/WiFiBlueToothSwitch.ino @@ -92,7 +92,7 @@ void WiFiEvent(WiFiEvent_t event){ break; case ARDUINO_EVENT_WIFI_STA_GOT_IP6: Serial.print("STA IPv6: "); - Serial.println(WiFi.localIPv6()); + Serial.println(WiFi.linkLocalIPv6()); break; case ARDUINO_EVENT_WIFI_STA_GOT_IP: Serial.print("STA IPv4: "); diff --git a/libraries/WiFi/examples/WiFiIPv6/WiFiIPv6.ino b/libraries/WiFi/examples/WiFiIPv6/WiFiIPv6.ino index c7edd384d82..2ab472d56f7 100644 --- a/libraries/WiFi/examples/WiFiIPv6/WiFiIPv6.ino +++ b/libraries/WiFi/examples/WiFiIPv6/WiFiIPv6.ino @@ -79,11 +79,11 @@ void WiFiEvent(WiFiEvent_t event){ break; case ARDUINO_EVENT_WIFI_STA_GOT_IP6: Serial.print("STA IPv6: "); - Serial.println(WiFi.localIPv6()); + Serial.println(WiFi.linkLocalIPv6()); break; case ARDUINO_EVENT_WIFI_AP_GOT_IP6: Serial.print("AP IPv6: "); - Serial.println(WiFi.softAPIPv6()); + Serial.println(WiFi.softAPlinkLocalIPv6()); break; case ARDUINO_EVENT_WIFI_STA_GOT_IP: wifiOnConnect(); diff --git a/libraries/WiFi/src/WiFiAP.cpp b/libraries/WiFi/src/WiFiAP.cpp index 6d0570e19e8..bd75b8b0795 100644 --- a/libraries/WiFi/src/WiFiAP.cpp +++ b/libraries/WiFi/src/WiFiAP.cpp @@ -202,9 +202,9 @@ bool WiFiAPClass::softAPenableIPv6(bool enable) * @return IPAddress softAP IPv6 */ -IPAddress WiFiAPClass::softAPIPv6() +IPAddress WiFiAPClass::softAPlinkLocalIPv6() { - return AP.localIPv6(); + return AP.linkLocalIPv6(); } #endif /* SOC_WIFI_SUPPORTED */ diff --git a/libraries/WiFi/src/WiFiAP.h b/libraries/WiFi/src/WiFiAP.h index 6dbaad70562..2891f6e02e8 100644 --- a/libraries/WiFi/src/WiFiAP.h +++ b/libraries/WiFi/src/WiFiAP.h @@ -87,7 +87,7 @@ class WiFiAPClass uint8_t softAPSubnetCIDR(); bool softAPenableIPv6(bool enable=true); - IPAddress softAPIPv6(); + IPAddress softAPlinkLocalIPv6(); const char * softAPgetHostname(); bool softAPsetHostname(const char * hostname); diff --git a/libraries/WiFi/src/WiFiSTA.cpp b/libraries/WiFi/src/WiFiSTA.cpp index 22710676cf9..aeb1eaa5923 100644 --- a/libraries/WiFi/src/WiFiSTA.cpp +++ b/libraries/WiFi/src/WiFiSTA.cpp @@ -406,9 +406,9 @@ bool WiFiSTAClass::enableIPv6(bool en) * Get the station interface link-local IPv6 address. * @return IPAddress */ -IPAddress WiFiSTAClass::localIPv6() +IPAddress WiFiSTAClass::linkLocalIPv6() { - return STA.localIPv6(); + return STA.linkLocalIPv6(); } /** diff --git a/libraries/WiFi/src/WiFiSTA.h b/libraries/WiFi/src/WiFiSTA.h index fd17222877e..b63d25a0b0c 100644 --- a/libraries/WiFi/src/WiFiSTA.h +++ b/libraries/WiFi/src/WiFiSTA.h @@ -159,7 +159,7 @@ class WiFiSTAClass uint8_t subnetCIDR(); bool enableIPv6(bool en=true); - IPAddress localIPv6(); + IPAddress linkLocalIPv6(); IPAddress globalIPv6(); // ----------------------------------------------------------------------------------------------