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/

Revision:
11:3fb19220d9ec
Parent:
0:e3fb1267e3c3
Child:
12:aef29fbc4a62
--- a/examples/TcpServer/TcpServer.ino	Thu Dec 29 11:18:05 2016 +0000
+++ b/examples/TcpServer/TcpServer.ino	Thu Dec 29 13:07:19 2016 +0100
@@ -18,13 +18,25 @@
  * 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>
 #include "utility/logging.h"
 
 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
@@ -35,10 +47,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())
@@ -58,3 +75,6 @@
       client.stop();
     }
 }
+#if defined(__MBED__)
+}
+#endif