mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-20 21:01:25 +03:00
Added Printable interface class to allow printing of classes such as IPAddress
This commit is contained in:
@ -42,3 +42,13 @@ bool IPAddress::operator==(const uint8_t* addr)
|
||||
return memcmp(addr, _address, sizeof(_address)) == 0;
|
||||
}
|
||||
|
||||
void IPAddress::printTo(Print& p) const
|
||||
{
|
||||
for (int i =0; i < 3; i++)
|
||||
{
|
||||
p.print(_address[i], DEC);
|
||||
p.print('.');
|
||||
}
|
||||
p.print(_address[3], DEC);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user