mirror of
https://github.com/esp8266/Arduino.git
synced 2025-07-27 18:02:17 +03:00
Merge pull request #714 from martinayotte/esp8266
add toCharArray() to IPAddress class
This commit is contained in:
@ -64,3 +64,10 @@ size_t IPAddress::printTo(Print& p) const {
|
||||
return n;
|
||||
}
|
||||
|
||||
String IPAddress::toString()
|
||||
{
|
||||
char szRet[16];
|
||||
sprintf(szRet,"%u.%u.%u.%u", _address.bytes[0], _address.bytes[1], _address.bytes[2], _address.bytes[3]);
|
||||
return String(szRet);
|
||||
}
|
||||
|
||||
|
@ -21,6 +21,7 @@
|
||||
#define IPAddress_h
|
||||
|
||||
#include <stdint.h>
|
||||
#include <WString.h>
|
||||
#include <Printable.h>
|
||||
|
||||
// A class to make it easier to handle and pass around IP addresses
|
||||
@ -70,6 +71,7 @@ class IPAddress: public Printable {
|
||||
IPAddress& operator=(uint32_t address);
|
||||
|
||||
virtual size_t printTo(Print& p) const;
|
||||
String toString();
|
||||
|
||||
friend class EthernetClass;
|
||||
friend class UDP;
|
||||
|
Reference in New Issue
Block a user