mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-20 14:54:31 +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 flush() = 0;
|
||||||
virtual void stop() = 0;
|
virtual void stop() = 0;
|
||||||
virtual uint8_t connected() = 0;
|
virtual uint8_t connected() = 0;
|
||||||
virtual uint8_t operator==(int) = 0;
|
|
||||||
virtual uint8_t operator!=(int) = 0;
|
|
||||||
virtual operator bool() = 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
|
#ifndef server_h
|
||||||
#define server_h
|
#define server_h
|
||||||
|
|
||||||
#include "Print.h"
|
#include "NetServer.h"
|
||||||
|
|
||||||
class Client;
|
class Client;
|
||||||
|
|
||||||
class Server :
|
class Server :
|
||||||
public Print {
|
public NetServer {
|
||||||
private:
|
private:
|
||||||
uint16_t _port;
|
uint16_t _port;
|
||||||
void accept();
|
void accept();
|
||||||
public:
|
public:
|
||||||
Server(uint16_t);
|
Server(uint16_t);
|
||||||
Client available();
|
Client available();
|
||||||
void begin();
|
virtual void begin();
|
||||||
virtual void write(uint8_t);
|
virtual void write(uint8_t);
|
||||||
virtual void write(const char *str);
|
virtual void write(const char *str);
|
||||||
virtual void write(const uint8_t *buf, size_t size);
|
virtual void write(const uint8_t *buf, size_t size);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user