Example program for the LWIPInterface

Dependencies:   LWIPInterface NetworkSocketAPI mbed-rtos mbed

Fork of HelloESP8266Interface by NetworkSocketAPI

Example for the NetworkSocketAPI. Attempts to get the device's public facing IP address from ifcfg.me.

Revision:
50:a9926b8b21fe
Parent:
46:cf5ab96729e1
Child:
57:fb2f8e188383
--- a/main.cpp	Wed Mar 02 17:22:10 2016 +0000
+++ b/main.cpp	Wed Mar 09 06:04:19 2016 +0000
@@ -19,7 +19,10 @@
 #include "TCPSocket.h"
 
 DigitalOut myled(LED_GREEN);
-void flash(){ myled = !myled; }
+void flash()
+{
+    myled = !myled;
+}
 
 LWIPInterface eth;
 TCPSocket socket(&eth);
@@ -31,7 +34,7 @@
     printf("NetworkSocketAPI Example\r\n");
 
     eth.connect();
-    
+
     const char *ip = eth.getIPAddress();
     const char *mac = eth.getMACAddress();
     printf("IP Address is: %s\r\n", (ip) ? ip : "No IP");
@@ -48,6 +51,6 @@
     eth.disconnect();
 
     printf("Recieved: %ld bytes, %02x%02x%02x%02x\r\n", size,
-            recieved[0], recieved[1], recieved[2], recieved[3]);
+           recieved[0], recieved[1], recieved[2], recieved[3]);
     printf("NetworkSocketAPI Example Finished\r\n");
 }