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/TcpClient/TcpClient.ino
- Revision:
- 11:3fb19220d9ec
- Parent:
- 6:f092f8b320ae
- Child:
- 12:aef29fbc4a62
diff -r cd62b2205c2a -r 3fb19220d9ec examples/TcpClient/TcpClient.ino --- a/examples/TcpClient/TcpClient.ino Thu Dec 29 11:18:05 2016 +0000 +++ b/examples/TcpClient/TcpClient.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" EthernetClient client; signed long next; +#if defined(ARDUINO) void setup() { - +#endif +#if defined(__MBED__) +int main() { +#endif #if ACTLOGLEVEL>LOG_NONE LogObject.begin(9600); #endif @@ -43,10 +55,15 @@ #endif next = 0; +#if defined(ARDUINO) } void loop() { +#endif +#if defined(__MBED__) +while(true) { +#endif if (((signed long)(millis() - next)) > 0) { next = millis() + 5000; @@ -89,3 +106,6 @@ #endif } } +#if defined(__MBED__) +} +#endif