8000 add 1 more IPAddress constructor by d-a-v · Pull Request #5551 · esp8266/Arduino · GitHub
[go: up one dir, main page]

Skip to content

add 1 more IPAddress constructor #5551

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 26, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ditto
  • Loading branch information
d-a-v committed Dec 25, 2018
commit e33b35828688997ef386a280dec4e0a8ebaed3ec
10 changes: 5 additions & 5 deletions cores/esp8266/IPAddress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ IPAddress::IPAddress(const IPAddress& from)
ip_addr_copy(_ip, from._ip);
}

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

IPAddress::IPAddress() {
_ip = *IP_ANY_TYPE; // lwIP's v4-or-v6 generic address
}
Expand Down Expand Up @@ -192,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
3 changes: 2 additions & 1 deletion cores/esp8266/IPAddress.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ class IPAddress: public Printable {
// Constructors
IPAddress();
IPAddress(const IPAddress& from);
IPAddress(const ip_addr_t* from);
IPAddress(uint8_t first_octet, uint8_t second_octet, uint8_t third_octet, uint8_t fourth_octet);
IPAddress(uint32_t address) { ctor32(address); }
IPAddress(u32_t address) { ctor32(address); }
Expand Down Expand Up @@ -164,6 +163,8 @@ class IPAddress: public Printable {

#if LWIP_IPV6

IPAddress(const ip_addr_t* from);

uint16_t* raw6()
{
setV6();
Expand Down
0