Tests for LWIPInterface
Dependencies: LWIPInterface NSAPITests NetworkSocketAPI mbed-rtos mbed
Diff: main.cpp
- Revision:
- 3:50ac0af2ea9c
- Parent:
- 2:9181decb4d5c
--- a/main.cpp Wed Mar 09 07:04:37 2016 +0000 +++ b/main.cpp Thu Apr 21 01:55:23 2016 -0500 @@ -20,15 +20,29 @@ LWIPInterface iface; +Ticker blinker; +DigitalOut led(LED_GREEN); +void blink() { + led = !led; +} + int main() { - int32_t result = iface.connect(); + blinker.attach(blink, 0.5); + int result = iface.connect(); if (result) { printf("Interface failed to connect with code %d\r\n", result); - } else { - nsapi_tests("BSDInterface Tests", &iface, "0.0.0.0", 4000); - iface.disconnect(); + while (1); } + + nsapi_tests("LWIPInterface Tests", &iface, "0.0.0.0", 4000); + + result = iface.disconnect(); + if (result) { + printf("Interface failed to disconnect with code %d\r\n", result); + while (1); + } + while(1); }