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/
Diff: UIPUdp.h
- Revision:
- 8:b9332109461d
- Parent:
- 4:5c7337d5ba8e
- Child:
- 9:312e0937630f
--- a/UIPUdp.h Wed Dec 28 13:02:52 2016 +0000 +++ b/UIPUdp.h Wed Dec 28 15:56:02 2016 +0000 @@ -21,14 +21,15 @@ #define UIPUDP_H #include "ethernet_comp.h" -#if defined(__MBED__) - #include <mbed.h> - #include "mbed/Udp.h" -#endif #if defined(ARDUINO) #include <Arduino.h> #include <Udp.h> #endif +#if defined(__MBED__) + #include <mbed.h> + #include "mbed/Print.h" + #include "mbed/Udp.h" +#endif #include "utility/mempool.h" extern "C" { #include "utility/uip.h" @@ -46,9 +47,12 @@ bool send; } uip_udp_userdata_t; -class UIPUDP : public UDP -{ - +#if defined(__MBED__) + class UIPUDP : public Print, public UDP { +#else + class UIPUDP : public UDP { +#endif + private: struct uip_udp_conn *_uip_udp_conn; @@ -74,10 +78,9 @@ virtual size_t write(uint8_t); // Write size bytes from buffer into the packet virtual size_t write(const uint8_t *buffer, size_t size); - - #if defined(ARDUINO) - using Print::write; - #endif +//#if defined(ARDUINO) + using Print::write; +//#endif // Start processing the next available incoming packet // Returns the size of the packet in bytes, or 0 if no packets are available virtual int parsePacket(void);