aboutsummaryrefslogtreecommitdiff
path: root/cores/arduino/IPAddress.cpp
diff options
context:
space:
mode:
authoramcewen <amcewen@bcs.org.uk>2011-08-28 20:28:53 +0100
committeramcewen <amcewen@bcs.org.uk>2011-08-28 20:28:53 +0100
commit8ce77304f796e077f594859f270f9f024dc05605 (patch)
tree285233e5b57f0029551056b1951e4e539b265951 /cores/arduino/IPAddress.cpp
parente852be3e97763e621a0f8014a3db4bf92a650b50 (diff)
parentf9d50a793010db3a2968262f35d34edaf048a650 (diff)
Merge branch 'master' into wifly_integration
Diffstat (limited to 'cores/arduino/IPAddress.cpp')
-rw-r--r--cores/arduino/IPAddress.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/cores/arduino/IPAddress.cpp b/cores/arduino/IPAddress.cpp
index 408d518..fe3deb7 100644
--- a/cores/arduino/IPAddress.cpp
+++ b/cores/arduino/IPAddress.cpp
@@ -1,5 +1,5 @@
-#include <WProgram.h>
+#include <Arduino.h>
#include <IPAddress.h>
IPAddress::IPAddress()
@@ -42,3 +42,15 @@ bool IPAddress::operator==(const uint8_t* addr)
return memcmp(addr, _address, sizeof(_address)) == 0;
}
+size_t IPAddress::printTo(Print& p) const
+{
+ size_t n = 0;
+ for (int i =0; i < 3; i++)
+ {
+ n += p.print(_address[i], DEC);
+ n += p.print('.');
+ }
+ n += p.print(_address[3], DEC);
+ return n;
+}
+