1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-06 05:21:22 +03:00

add 1 more IPAddress constructor for IPv6 (#5551)

This commit is contained in:
david gauchard 2018-12-26 15:01:48 +01:00 committed by GitHub
parent 8049543e98
commit da7ffdaa28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 1 deletions

View File

@ -187,6 +187,11 @@ const IPAddress INADDR_NONE(255,255,255,255);
#if LWIP_IPV6 #if LWIP_IPV6
IPAddress::IPAddress(const ip_addr_t* from)
{
ip_addr_copy(_ip, *from);
}
bool IPAddress::fromString6(const char *address) { bool IPAddress::fromString6(const char *address) {
// TODO: test test test // TODO: test test test

View File

@ -163,6 +163,8 @@ class IPAddress: public Printable {
#if LWIP_IPV6 #if LWIP_IPV6
IPAddress(const ip_addr_t* from);
uint16_t* raw6() uint16_t* raw6()
{ {
setV6(); setV6();

View File

@ -98,7 +98,11 @@ void setup() {
Serial.println(); Serial.println();
Serial.println(ESP.getFullVersion()); 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.mode(WIFI_STA);
WiFi.begin(STASSID, STAPSK); WiFi.begin(STASSID, STAPSK);