Skip to content

Commit

Permalink
add 1 more IPAddress constructor for IPv6 (#5551)
Browse files Browse the repository at this point in the history
  • Loading branch information
d-a-v authored Dec 26, 2018
1 parent 8049543 commit da7ffda
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions cores/esp8266/IPAddress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,11 @@ const IPAddress INADDR_NONE(255,255,255,255);

#if LWIP_IPV6

IPAddress::IPAddress(const ip_addr_t* from)
{
ip_addr_copy(_ip, *from);
}

bool IPAddress::fromString6(const char *address) {
// TODO: test test test

Expand Down
2 changes: 2 additions & 0 deletions cores/esp8266/IPAddress.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ class IPAddress: public Printable {

#if LWIP_IPV6

IPAddress(const ip_addr_t* from);

uint16_t* raw6()
{
setV6();
Expand Down
6 changes: 5 additions & 1 deletion libraries/ESP8266WiFi/examples/IPv6/IPv6.ino
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,11 @@ void setup() {
Serial.println();
Serial.println(ESP.getFullVersion());

Serial.printf("IPV6 is%s enabled\n", LWIP_IPV6 ? emptyString.c_str() : " NOT");
#if LWIP_IPV6
Serial.printf("IPV6 is enabled\n");
#else
Serial.printf("IPV6 is not enabled\n");
#endif

WiFi.mode(WIFI_STA);
WiFi.begin(STASSID, STAPSK);
Expand Down

0 comments on commit da7ffda

Please sign in to comment.