From 17d8fcb46d49fc284671d2f124a01e69ce86b0c8 Mon Sep 17 00:00:00 2001 From: amcewen Date: Thu, 31 Mar 2011 16:19:17 +0100 Subject: [PATCH] Pulled out Server API into the NetServer base class, and a few minor changes to get the NetClient API to work well with the WiFly library --- hardware/arduino/cores/arduino/NetClient.h | 2 -- hardware/arduino/cores/arduino/NetServer.h | 11 +++++++++++ libraries/Ethernet/Server.h | 6 +++--- 3 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 hardware/arduino/cores/arduino/NetServer.h diff --git a/hardware/arduino/cores/arduino/NetClient.h b/hardware/arduino/cores/arduino/NetClient.h index d8df9149a..ea64664e7 100644 --- a/hardware/arduino/cores/arduino/NetClient.h +++ b/hardware/arduino/cores/arduino/NetClient.h @@ -20,8 +20,6 @@ public: virtual void flush() = 0; virtual void stop() = 0; virtual uint8_t connected() = 0; - virtual uint8_t operator==(int) = 0; - virtual uint8_t operator!=(int) = 0; virtual operator bool() = 0; }; diff --git a/hardware/arduino/cores/arduino/NetServer.h b/hardware/arduino/cores/arduino/NetServer.h new file mode 100644 index 000000000..91f484895 --- /dev/null +++ b/hardware/arduino/cores/arduino/NetServer.h @@ -0,0 +1,11 @@ +#ifndef netserver_h +#define netserver_h + +class NetClient; + +class NetServer { +public: + virtual void begin() =0; +}; + +#endif diff --git a/libraries/Ethernet/Server.h b/libraries/Ethernet/Server.h index 6aa5d3aaf..4c3bd1b54 100644 --- a/libraries/Ethernet/Server.h +++ b/libraries/Ethernet/Server.h @@ -1,19 +1,19 @@ #ifndef server_h #define server_h -#include "Print.h" +#include "NetServer.h" class Client; class Server : -public Print { +public NetServer { private: uint16_t _port; void accept(); public: Server(uint16_t); Client available(); - void begin(); + virtual void begin(); virtual void write(uint8_t); virtual void write(const char *str); virtual void write(const uint8_t *buf, size_t size);