1
0
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:
amcewen
2011-04-01 21:10:38 +01:00
parent 7f18110b80
commit 3540d92eb2
5 changed files with 61 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);
}