1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-30 16:24:09 +03:00

Added Printable interface class to allow printing of classes such as IPAddress

This commit is contained in:
David A. Mellis
2011-06-04 09:19:17 -04:00
parent 2711c9910b
commit 87a04fc064
5 changed files with 66 additions and 1 deletions

View File

@ -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);
}