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/
UIPServer.h@39:deeb00b81cc9, 2018-01-23 (annotated)
- Committer:
- cassyarduino
- Date:
- Tue Jan 23 15:08:43 2018 +0100
- Revision:
- 39:deeb00b81cc9
- Parent:
- 33:7ba5d53df0f2
Release: 2.0.4
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
cassyarduino | 0:e3fb1267e3c3 | 1 | /* |
cassyarduino | 0:e3fb1267e3c3 | 2 | UIPServer.h - Arduino implementation of a uIP wrapper class. |
cassyarduino | 0:e3fb1267e3c3 | 3 | Copyright (c) 2013 Norbert Truchsess <norbert.truchsess@t-online.de> |
cassyarduino | 0:e3fb1267e3c3 | 4 | All rights reserved. |
cassyarduino | 0:e3fb1267e3c3 | 5 | |
cassyarduino | 0:e3fb1267e3c3 | 6 | This program is free software: you can redistribute it and/or modify |
cassyarduino | 0:e3fb1267e3c3 | 7 | it under the terms of the GNU General Public License as published by |
cassyarduino | 0:e3fb1267e3c3 | 8 | the Free Software Foundation, either version 3 of the License, or |
cassyarduino | 0:e3fb1267e3c3 | 9 | (at your option) any later version. |
cassyarduino | 0:e3fb1267e3c3 | 10 | |
cassyarduino | 0:e3fb1267e3c3 | 11 | This program is distributed in the hope that it will be useful, |
cassyarduino | 0:e3fb1267e3c3 | 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
cassyarduino | 0:e3fb1267e3c3 | 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
cassyarduino | 0:e3fb1267e3c3 | 14 | GNU General Public License for more details. |
cassyarduino | 0:e3fb1267e3c3 | 15 | |
cassyarduino | 0:e3fb1267e3c3 | 16 | You should have received a copy of the GNU General Public License |
cassyarduino | 0:e3fb1267e3c3 | 17 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
cassyarduino | 0:e3fb1267e3c3 | 18 | */ |
cassyarduino | 0:e3fb1267e3c3 | 19 | #ifndef UIPSERVER_H |
cassyarduino | 0:e3fb1267e3c3 | 20 | #define UIPSERVER_H |
cassyarduino | 0:e3fb1267e3c3 | 21 | |
cassyarduino | 0:e3fb1267e3c3 | 22 | #include "ethernet_comp.h" |
cassyarduino | 0:e3fb1267e3c3 | 23 | #if defined(ARDUINO) |
cassyarduino | 33:7ba5d53df0f2 | 24 | #if defined(__RFduino__) |
cassyarduino | 33:7ba5d53df0f2 | 25 | #include "Print.h" |
cassyarduino | 33:7ba5d53df0f2 | 26 | #else |
cassyarduino | 33:7ba5d53df0f2 | 27 | #include "Print.h" |
cassyarduino | 33:7ba5d53df0f2 | 28 | #endif |
cassyarduino | 33:7ba5d53df0f2 | 29 | #if defined(__STM32F3__) || defined(STM32F3) || defined(__RFduino__) |
cassyarduino | 19:e416943f7119 | 30 | #include "mbed/Server.h" |
cassyarduino | 19:e416943f7119 | 31 | #else |
cassyarduino | 19:e416943f7119 | 32 | #include "Server.h" |
cassyarduino | 19:e416943f7119 | 33 | #endif |
cassyarduino | 0:e3fb1267e3c3 | 34 | #endif |
cassyarduino | 0:e3fb1267e3c3 | 35 | #if defined(__MBED__) |
cassyarduino | 8:b9332109461d | 36 | #include "mbed/Print.h" |
cassyarduino | 8:b9332109461d | 37 | #include "mbed/Server.h" |
cassyarduino | 0:e3fb1267e3c3 | 38 | #endif |
cassyarduino | 0:e3fb1267e3c3 | 39 | #include "UIPClient.h" |
cassyarduino | 0:e3fb1267e3c3 | 40 | |
cassyarduino | 33:7ba5d53df0f2 | 41 | #if defined(ARDUINO) && !defined(STM32F3) && !defined(__RFduino__) |
cassyarduino | 10:cd62b2205c2a | 42 | class UIPServer : public Server { |
cassyarduino | 10:cd62b2205c2a | 43 | #endif |
cassyarduino | 33:7ba5d53df0f2 | 44 | #if defined(__MBED__) || defined(STM32F3) || defined(__RFduino__) |
cassyarduino | 10:cd62b2205c2a | 45 | class UIPServer : public Print, public Server { |
cassyarduino | 10:cd62b2205c2a | 46 | #endif |
cassyarduino | 0:e3fb1267e3c3 | 47 | public: |
cassyarduino | 0:e3fb1267e3c3 | 48 | UIPServer(uint16_t); |
cassyarduino | 0:e3fb1267e3c3 | 49 | UIPClient available(); |
cassyarduino | 5:f9a2b1916a8d | 50 | virtual void begin(); |
cassyarduino | 9:312e0937630f | 51 | virtual size_t write(uint8_t); |
cassyarduino | 9:312e0937630f | 52 | virtual size_t write(const uint8_t *buf, size_t size); |
cassyarduino | 9:312e0937630f | 53 | |
cassyarduino | 8:b9332109461d | 54 | using Print::write; |
cassyarduino | 0:e3fb1267e3c3 | 55 | |
cassyarduino | 0:e3fb1267e3c3 | 56 | private: |
cassyarduino | 0:e3fb1267e3c3 | 57 | uint16_t _port; |
cassyarduino | 0:e3fb1267e3c3 | 58 | }; |
cassyarduino | 0:e3fb1267e3c3 | 59 | |
cassyarduino | 0:e3fb1267e3c3 | 60 | #endif |