mbed OS5

Fork of UIPEthernet by Zoltan Hudak

Committer:
hudakz
Date:
Sat Dec 20 11:10:40 2014 +0000
Revision:
3:5b17e4656dd0
Child:
4:d774541a34da
02 Name clash with "Ethernet" fixed for LPC1768

Who changed what in which revision?

UserRevisionLine numberNew contents of line
hudakz 3:5b17e4656dd0 1 /*
hudakz 3:5b17e4656dd0 2 Client.h - Base class that provides Client
hudakz 3:5b17e4656dd0 3 Copyright (c) 2011 Adrian McEwen. All right reserved.
hudakz 3:5b17e4656dd0 4
hudakz 3:5b17e4656dd0 5 Modified (ported to mbed) by Zoltan Hudak <hudakz@inbox.com>
hudakz 3:5b17e4656dd0 6
hudakz 3:5b17e4656dd0 7 This library is free software; you can redistribute it and/or
hudakz 3:5b17e4656dd0 8 modify it under the terms of the GNU Lesser General Public
hudakz 3:5b17e4656dd0 9 License as published by the Free Software Foundation; either
hudakz 3:5b17e4656dd0 10 version 2.1 of the License, or (at your option) any later version.
hudakz 3:5b17e4656dd0 11
hudakz 3:5b17e4656dd0 12 This library is distributed in the hope that it will be useful,
hudakz 3:5b17e4656dd0 13 but WITHOUT ANY WARRANTY; without even the implied warranty of
hudakz 3:5b17e4656dd0 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
hudakz 3:5b17e4656dd0 15 Lesser General Public License for more details.
hudakz 3:5b17e4656dd0 16
hudakz 3:5b17e4656dd0 17 You should have received a copy of the GNU Lesser General Public
hudakz 3:5b17e4656dd0 18 License along with this library; if not, write to the Free Software
hudakz 3:5b17e4656dd0 19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
hudakz 3:5b17e4656dd0 20 */
hudakz 3:5b17e4656dd0 21 #ifndef client_h
hudakz 3:5b17e4656dd0 22 #define client_h
hudakz 3:5b17e4656dd0 23 //#include "Print.h"
hudakz 3:5b17e4656dd0 24 //#include "Stream.h"
hudakz 3:5b17e4656dd0 25 #include "IPAddress.h"
hudakz 3:5b17e4656dd0 26
hudakz 3:5b17e4656dd0 27 //class Client : public Stream {
hudakz 3:5b17e4656dd0 28 class Client
hudakz 3:5b17e4656dd0 29 {
hudakz 3:5b17e4656dd0 30 public:
hudakz 3:5b17e4656dd0 31 virtual int connect(IPAddress ip, uint16_t port) = 0;
hudakz 3:5b17e4656dd0 32 virtual int connect(const char* host, uint16_t port) = 0;
hudakz 3:5b17e4656dd0 33 virtual size_t write(uint8_t) = 0;
hudakz 3:5b17e4656dd0 34 virtual size_t write(const uint8_t* buf, size_t size) = 0;
hudakz 3:5b17e4656dd0 35 virtual int available(void) = 0;
hudakz 3:5b17e4656dd0 36 virtual int read(void) = 0;
hudakz 3:5b17e4656dd0 37 virtual int read(uint8_t* buf, size_t size) = 0;
hudakz 3:5b17e4656dd0 38 virtual int peek(void) = 0;
hudakz 3:5b17e4656dd0 39 virtual void flush(void) = 0;
hudakz 3:5b17e4656dd0 40 virtual void stop(void) = 0;
hudakz 3:5b17e4656dd0 41 virtual uint8_t connected(void) = 0;
hudakz 3:5b17e4656dd0 42 virtual operator bool(void) = 0;
hudakz 3:5b17e4656dd0 43 protected:
hudakz 3:5b17e4656dd0 44 uint8_t* rawIPAddress(IPAddress& addr) { return addr.raw_address(); };
hudakz 3:5b17e4656dd0 45 };
hudakz 3:5b17e4656dd0 46 #endif
hudakz 3:5b17e4656dd0 47
hudakz 3:5b17e4656dd0 48