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:
6:f092f8b320ae
Child:
12:aef29fbc4a62
--- a/examples/UdpClient/UdpClient.ino	Thu Dec 29 11:18:05 2016 +0000
+++ b/examples/UdpClient/UdpClient.ino	Thu Dec 29 13:07:19 2016 +0100
@@ -16,14 +16,26 @@
  * Copyright (C) 2013 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"
 
 EthernetUDP udp;
 unsigned long next;
 
+#if defined(ARDUINO)
 void setup() {
-
+#endif  
+#if defined(__MBED__)
+int main() {
+#endif
   #if ACTLOGLEVEL>LOG_NONE
     LogObject.begin(9600);
   #endif
@@ -33,10 +45,15 @@
   Ethernet.begin(mac,IPAddress(192,168,0,6));
 
   next = millis()+5000;
+#if defined(ARDUINO)
 }
 
 void loop() {
+#endif  
 
+#if defined(__MBED__)
+while(true) {
+#endif
   int success;
   int len = 0;
 
@@ -105,3 +122,6 @@
       next = millis()+5000;
     }
 }
+#if defined(__MBED__)
+}
+#endif