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:
59:14d6716bc772
Parent:
58:7033f5893210
Child:
65:826ec2bbec51
diff -r 7033f5893210 -r 14d6716bc772 main.cpp
--- a/main.cpp	Tue Apr 05 15:32:00 2016 -0500
+++ b/main.cpp	Tue Apr 05 23:40:09 2016 +0000
@@ -25,7 +25,6 @@
 }
 
 LWIPInterface eth;
-TCPSocket socket(&eth);
 
 int main()
 {
@@ -39,7 +38,11 @@
     const char *mac = eth.get_mac_address();
     printf("IP Address is: %s\r\n", (ip) ? ip : "No IP");
     printf("MAC Address is: %s\r\n", (mac) ? mac : "No MAC");
+    
+    SocketAddress addr(&eth, "time-a.nist.gov", 37);
+    printf("time-a.nist.gov resolved to: %s\r\n", addr.get_ip_address());
 
+    TCPSocket socket(&eth);
     socket.connect("time-a.nist.gov", 37);
 
     char recieved[100] = {0};