UIPEthernet library for Arduino IDE, Eclipse with arduino plugin and MBED/SMeshStudio (AVR,STM32F,ESP8266,Intel ARC32,Nordic nRF51,Teensy boards,Realtek Ameba(RTL8195A,RTL8710)), ENC28j60 network chip. Compatible with Wiznet W5100 Ethernet library API. Compiled and tested on Nucleo-F302R8. Master repository is: https://github.com/UIPEthernet/UIPEthernet/
mbed/Client.h@1:34b5616a463d, 2016-12-27 (annotated)
- Committer:
- cassyarduino
- Date:
- Tue Dec 27 11:47:13 2016 +0100
- Revision:
- 1:34b5616a463d
- Child:
- 35:f9f3a91fe4d4
changes
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
cassyarduino | 1:34b5616a463d | 1 | /* |
cassyarduino | 1:34b5616a463d | 2 | Client.h - Base class that provides Client |
cassyarduino | 1:34b5616a463d | 3 | Copyright (c) 2011 Adrian McEwen. All right reserved. |
cassyarduino | 1:34b5616a463d | 4 | |
cassyarduino | 1:34b5616a463d | 5 | Modified (ported to mbed) by Zoltan Hudak <hudakz@inbox.com> |
cassyarduino | 1:34b5616a463d | 6 | |
cassyarduino | 1:34b5616a463d | 7 | This library is free software; you can redistribute it and/or |
cassyarduino | 1:34b5616a463d | 8 | modify it under the terms of the GNU Lesser General Public |
cassyarduino | 1:34b5616a463d | 9 | License as published by the Free Software Foundation; either |
cassyarduino | 1:34b5616a463d | 10 | version 2.1 of the License, or (at your option) any later version. |
cassyarduino | 1:34b5616a463d | 11 | |
cassyarduino | 1:34b5616a463d | 12 | This library is distributed in the hope that it will be useful, |
cassyarduino | 1:34b5616a463d | 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
cassyarduino | 1:34b5616a463d | 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
cassyarduino | 1:34b5616a463d | 15 | Lesser General Public License for more details. |
cassyarduino | 1:34b5616a463d | 16 | |
cassyarduino | 1:34b5616a463d | 17 | You should have received a copy of the GNU Lesser General Public |
cassyarduino | 1:34b5616a463d | 18 | License along with this library; if not, write to the Free Software |
cassyarduino | 1:34b5616a463d | 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
cassyarduino | 1:34b5616a463d | 20 | */ |
cassyarduino | 1:34b5616a463d | 21 | #ifndef client_h |
cassyarduino | 1:34b5616a463d | 22 | #define client_h |
cassyarduino | 1:34b5616a463d | 23 | #include "IPAddress.h" |
cassyarduino | 1:34b5616a463d | 24 | |
cassyarduino | 1:34b5616a463d | 25 | class Client |
cassyarduino | 1:34b5616a463d | 26 | { |
cassyarduino | 1:34b5616a463d | 27 | public: |
cassyarduino | 1:34b5616a463d | 28 | virtual int connect(IPAddress ip, uint16_t port) = 0; |
cassyarduino | 1:34b5616a463d | 29 | virtual int connect(const char* host, uint16_t port) = 0; |
cassyarduino | 1:34b5616a463d | 30 | virtual size_t write(uint8_t) = 0; |
cassyarduino | 1:34b5616a463d | 31 | virtual size_t write(const uint8_t* buf, size_t size) = 0; |
cassyarduino | 1:34b5616a463d | 32 | virtual int available(void) = 0; |
cassyarduino | 1:34b5616a463d | 33 | virtual int read(void) = 0; |
cassyarduino | 1:34b5616a463d | 34 | virtual int read(uint8_t* buf, size_t size) = 0; |
cassyarduino | 1:34b5616a463d | 35 | virtual int peek(void) = 0; |
cassyarduino | 1:34b5616a463d | 36 | virtual void flush(void) = 0; |
cassyarduino | 1:34b5616a463d | 37 | virtual void stop(void) = 0; |
cassyarduino | 1:34b5616a463d | 38 | virtual uint8_t connected(void) = 0; |
cassyarduino | 1:34b5616a463d | 39 | virtual operator bool(void) = 0; |
cassyarduino | 1:34b5616a463d | 40 | protected: |
cassyarduino | 1:34b5616a463d | 41 | uint8_t* rawIPAddress(IPAddress& addr) { return addr.raw_address(); }; |
cassyarduino | 1:34b5616a463d | 42 | }; |
cassyarduino | 1:34b5616a463d | 43 | #endif |