From 54d367b1e01af1f41fd0d1b8d199cf7c8c375b1e Mon Sep 17 00:00:00 2001 From: "David A. Mellis" Date: Wed, 11 Aug 2010 18:19:01 +0000 Subject: [PATCH] Making Client inherit from Stream, which unforunately means taking peek() out of Stream for now, since there's no immediate implementation for Client. --- build/shared/revisions.txt | 4 ++-- hardware/arduino/cores/arduino/Stream.h | 1 - libraries/Ethernet/Client.h | 8 ++++---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/build/shared/revisions.txt b/build/shared/revisions.txt index 32e748f2d..0b068809e 100644 --- a/build/shared/revisions.txt +++ b/build/shared/revisions.txt @@ -23,8 +23,8 @@ ARDUINO 0019 * Added Serial.peek() method. http://code.google.com/p/arduino/issues/detail?id=270 -* Added Stream base class to Serial object (w/ available(), peek(), read() - and the write(), print(), and println() functions from the Print class). +* Added Stream base class to Serial object (w/ available(), read() and + the write(), print(), and println() functions from the Print class). http://code.google.com/p/arduino/issues/detail?id=60 * Disabling interrupts while digitalWrite() and pinMode() write to pins. diff --git a/hardware/arduino/cores/arduino/Stream.h b/hardware/arduino/cores/arduino/Stream.h index 1c72ec23c..c98759b31 100644 --- a/hardware/arduino/cores/arduino/Stream.h +++ b/hardware/arduino/cores/arduino/Stream.h @@ -27,7 +27,6 @@ class Stream : public Print { public: virtual int available() = 0; - virtual int peek() = 0; virtual int read() = 0; virtual void flush() = 0; }; diff --git a/libraries/Ethernet/Client.h b/libraries/Ethernet/Client.h index 3a2a1a479..b4e6389dc 100644 --- a/libraries/Ethernet/Client.h +++ b/libraries/Ethernet/Client.h @@ -3,7 +3,7 @@ #include "WProgram.h" #include "Print.h" -class Client : public Print { +class Client : public Stream { public: Client(); @@ -15,9 +15,9 @@ public: virtual void write(uint8_t); virtual void write(const char *str); virtual void write(const uint8_t *buf, size_t size); - int available(); - int read(); - void flush(); + virtual int available(); + virtual int read(); + virtual void flush(); void stop(); uint8_t connected(); uint8_t operator==(int);