const correctness (#89)

make IPAddress.toString() const method, it doesn't modify anything
within the class.
This commit is contained in:
Victor Tseng 2016-12-12 07:32:55 +08:00 committed by Me No Dev
parent d8e74f2cbf
commit 54b1b8b1d3
2 changed files with 3 additions and 3 deletions

View File

@ -72,7 +72,7 @@ size_t IPAddress::printTo(Print& p) const
return n;
}
String IPAddress::toString()
String IPAddress::toString() const
{
char szRet[16];
sprintf(szRet,"%u.%u.%u.%u", _address.bytes[0], _address.bytes[1], _address.bytes[2], _address.bytes[3]);

View File

@ -81,7 +81,7 @@ public:
IPAddress& operator=(uint32_t address);
virtual size_t printTo(Print& p) const;
String toString();
String toString() const;
friend class EthernetClass;
friend class UDP;