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: examples/EchoServer/EchoServer.ino
- Revision:
- 11:3fb19220d9ec
- Parent:
- 0:e3fb1267e3c3
- Child:
- 12:aef29fbc4a62
--- a/examples/EchoServer/EchoServer.ino Thu Dec 29 11:18:05 2016 +0000 +++ b/examples/EchoServer/EchoServer.ino Thu Dec 29 13:07:19 2016 +0100 @@ -18,6 +18,14 @@ * Adaption to Enc28J60 by Norbert Truchsess <norbert.truchsess@t-online.de> */ +#if defined(__MBED__) + #include <mbed.h> + #include "mbed/millis.h" + #define delay(x) wait_ms(x) + #define PROGMEM + #include "mbed/Print.h" +#endif + #include <UIPEthernet.h> // The connection_data struct needs to be defined in an external file. #include <UIPServer.h> @@ -26,8 +34,12 @@ EthernetServer server = EthernetServer(1000); -void setup() -{ +#if defined(ARDUINO) +void setup() { +#endif +#if defined(__MBED__) +int main() { +#endif #if ACTLOGLEVEL>LOG_NONE LogObject.begin(9600); #endif @@ -38,10 +50,15 @@ Ethernet.begin(mac,myIP); server.begin(); +#if defined(ARDUINO) } -void loop() -{ +void loop() { +#endif + +#if defined(__MBED__) +while(true) { +#endif size_t size; if (EthernetClient client = server.available()) @@ -61,3 +78,6 @@ } } } +#if defined(__MBED__) +} +#endif