Skip to content

Commit 7afd573

Browse files
committed
Rename IPv6 getters to clarify that they are returning LinkLocal address
cc @sgryphon
1 parent bf97e36 commit 7afd573

File tree

9 files changed

+14
-14
lines changed

9 files changed

+14
-14
lines changed

docs/en/api/wifi.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ Function to get the IPv6 address.
345345

346346
.. code-block:: arduino
347347
348-
IPAddress softAPIPv6();
348+
IPAddress softAPlinkLocalIPv6();
349349
350350
The function will return the AP IPv6 address in ``IPAddress`` format.
351351

libraries/Networking/src/ESP_Network_Interface.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ bool ESP_Network_Interface::hasIP() const {
284284
return (getStatusBits() & ESP_NETIF_HAS_IP_BIT) != 0;
285285
}
286286

287-
bool ESP_Network_Interface::hasLocalIPv6() const {
287+
bool ESP_Network_Interface::hasLinkLocalIPv6() const {
288288
return (getStatusBits() & ESP_NETIF_HAS_LOCAL_IP6_BIT) != 0;
289289
}
290290

@@ -645,7 +645,7 @@ uint8_t ESP_Network_Interface::subnetCIDR() const
645645
return calculateSubnetCIDR(IPAddress(ip.netmask.addr));
646646
}
647647

648-
IPAddress ESP_Network_Interface::localIPv6() const
648+
IPAddress ESP_Network_Interface::linkLocalIPv6() const
649649
{
650650
if(_esp_netif == NULL){
651651
return IPAddress(IPv6);

libraries/Networking/src/ESP_Network_Interface.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class ESP_Network_Interface: public Printable {
4545
bool started() const;
4646
bool connected() const;
4747
bool hasIP() const;
48-
bool hasLocalIPv6() const;
48+
bool hasLinkLocalIPv6() const;
4949
bool hasGlobalIPv6() const;
5050
bool enableIPv6(bool en=true);
5151

@@ -63,7 +63,7 @@ class ESP_Network_Interface: public Printable {
6363
IPAddress broadcastIP() const;
6464
IPAddress networkID() const;
6565
uint8_t subnetCIDR() const;
66-
IPAddress localIPv6() const;
66+
IPAddress linkLocalIPv6() const;
6767
IPAddress globalIPv6() const;
6868

6969
size_t printTo(Print & out) const;

libraries/WiFi/examples/WiFiBlueToothSwitch/WiFiBlueToothSwitch.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ void WiFiEvent(WiFiEvent_t event){
9292
break;
9393
case ARDUINO_EVENT_WIFI_STA_GOT_IP6:
9494
Serial.print("STA IPv6: ");
95-
Serial.println(WiFi.localIPv6());
95+
Serial.println(WiFi.linkLocalIPv6());
9696
break;
9797
case ARDUINO_EVENT_WIFI_STA_GOT_IP:
9898
Serial.print("STA IPv4: ");

libraries/WiFi/examples/WiFiIPv6/WiFiIPv6.ino

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@ void WiFiEvent(WiFiEvent_t event){
7979
break;
8080
case ARDUINO_EVENT_WIFI_STA_GOT_IP6:
8181
Serial.print("STA IPv6: ");
82-
Serial.println(WiFi.localIPv6());
82+
Serial.println(WiFi.linkLocalIPv6());
8383
break;
8484
case ARDUINO_EVENT_WIFI_AP_GOT_IP6:
8585
Serial.print("AP IPv6: ");
86-
Serial.println(WiFi.softAPIPv6());
86+
Serial.println(WiFi.softAPlinkLocalIPv6());
8787
break;
8888
case ARDUINO_EVENT_WIFI_STA_GOT_IP:
8989
wifiOnConnect();

libraries/WiFi/src/WiFiAP.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,9 @@ bool WiFiAPClass::softAPenableIPv6(bool enable)
202202
* @return IPAddress softAP IPv6
203203
*/
204204

205-
IPAddress WiFiAPClass::softAPIPv6()
205+
IPAddress WiFiAPClass::softAPlinkLocalIPv6()
206206
{
207-
return AP.localIPv6();
207+
return AP.linkLocalIPv6();
208208
}
209209

210210
#endif /* SOC_WIFI_SUPPORTED */

libraries/WiFi/src/WiFiAP.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class WiFiAPClass
8787
uint8_t softAPSubnetCIDR();
8888

8989
bool softAPenableIPv6(bool enable=true);
90-
IPAddress softAPIPv6();
90+
IPAddress softAPlinkLocalIPv6();
9191

9292
const char * softAPgetHostname();
9393
bool softAPsetHostname(const char * hostname);

libraries/WiFi/src/WiFiSTA.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -406,9 +406,9 @@ bool WiFiSTAClass::enableIPv6(bool en)
406406
* Get the station interface link-local IPv6 address.
407407
* @return IPAddress
408408
*/
409-
IPAddress WiFiSTAClass::localIPv6()
409+
IPAddress WiFiSTAClass::linkLocalIPv6()
410410
{
411-
return STA.localIPv6();
411+
return STA.linkLocalIPv6();
412412
}
413413

414414
/**

libraries/WiFi/src/WiFiSTA.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ class WiFiSTAClass
159159
uint8_t subnetCIDR();
160160

161161
bool enableIPv6(bool en=true);
162-
IPAddress localIPv6();
162+
IPAddress linkLocalIPv6();
163163
IPAddress globalIPv6();
164164

165165
// ----------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)