sanguino/cores/arduino/Client.h

Fri, 17 Nov 2017 10:13:31 +0100

author
mdd
date
Fri, 17 Nov 2017 10:13:31 +0100
changeset 3
770b218a4931
parent 2
b373b0288715
permissions
-rw-r--r--

proper configuration, homing and planner optimization

2
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
1 #ifndef client_h
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
2 #define client_h
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
3 #include "Print.h"
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
4 #include "Stream.h"
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
5 #include "IPAddress.h"
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
6
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
7 class Client : public Stream {
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
8
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
9 public:
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
10 virtual int connect(IPAddress ip, uint16_t port) =0;
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
11 virtual int connect(const char *host, uint16_t port) =0;
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
12 virtual size_t write(uint8_t) =0;
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
13 virtual size_t write(const uint8_t *buf, size_t size) =0;
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
14 virtual int available() = 0;
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
15 virtual int read() = 0;
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
16 virtual int read(uint8_t *buf, size_t size) = 0;
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
17 virtual int peek() = 0;
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
18 virtual void flush() = 0;
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
19 virtual void stop() = 0;
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
20 virtual uint8_t connected() = 0;
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
21 virtual operator bool() = 0;
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
22 protected:
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
23 uint8_t* rawIPAddress(IPAddress& addr) { return addr.raw_address(); };
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
24 };
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
25
b373b0288715 added missing sanguino files
mbayer
parents:
diff changeset
26 #endif

mercurial