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

@ -26,9 +26,11 @@
#ifndef IPAddress_h
#define IPAddress_h
#include <Printable.h>
// A class to make it easier to handle and pass around IP addresses
class IPAddress {
class IPAddress : public Printable {
private:
uint8_t _address[4]; // IPv4 address
// Access the raw byte array containing the address. Because this returns a pointer
@ -58,6 +60,8 @@ public:
IPAddress& operator=(const uint8_t *address);
IPAddress& operator=(uint32_t address);
virtual void printTo(Print& p) const;
friend class EthernetClass;
friend class UDP;
friend class Client;