1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-12 01:53:07 +03:00

Split AddrList into object-iterator-container components (#5410)

* Split AddrList into object-iterator-container components

* Update AddrList.h

Remove gist code
This commit is contained in:
Develo
2018-12-02 23:46:39 -03:00
committed by GitHub
parent 773f306ef9
commit e5d50a6e4b
2 changed files with 121 additions and 93 deletions

View File

@ -66,16 +66,16 @@ void status(Print& out) {
out.println(F("(with 'telnet <addr> or 'nc -u <addr> 23')"));
for (auto a : addrList) {
out.printf("IF='%s' IPv6=%d local=%d hostname='%s' addr= %s",
a->iface().c_str(),
!a->addr().isV4(),
a->addr().isLocal(),
a->hostname(),
a->addr().toString().c_str());
a.iface().c_str(),
!a.addr().isV4(),
a.addr().isLocal(),
a.hostname(),
a.addr().toString().c_str());
if (a->isLegacy()) {
if (a.isLegacy()) {
out.printf(" / mask:%s / gw:%s",
a->netmask().toString().c_str(),
a->gw().toString().c_str());
a.netmask().toString().c_str(),
a.gw().toString().c_str());
}
out.println();
@ -121,9 +121,9 @@ void setup() {
for (bool configured = false; !configured;) {
for (auto addr : addrList)
if ((configured = !addr->isLocal()
// && addr->isV6() // uncomment when IPv6 is mandatory
// && addr->ifnumber() == STATION_IF
if ((configured = !addr.isLocal()
// && addr.isV6() // uncomment when IPv6 is mandatory
// && addr.ifnumber() == STATION_IF
)) {
break;
}