mirror of
https://github.com/arduino/Arduino.git
synced 2024-11-29 10:24:12 +01:00
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
This commit is contained in:
parent
a5f6a42dd7
commit
17d8fcb46d
@ -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;
|
||||
};
|
||||
|
||||
|
11
hardware/arduino/cores/arduino/NetServer.h
Normal file
11
hardware/arduino/cores/arduino/NetServer.h
Normal file
@ -0,0 +1,11 @@
|
||||
#ifndef netserver_h
|
||||
#define netserver_h
|
||||
|
||||
class NetClient;
|
||||
|
||||
class NetServer {
|
||||
public:
|
||||
virtual void begin() =0;
|
||||
};
|
||||
|
||||
#endif
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user