Example program for the C027Interface

Dependencies:   C027Interface NetworkSocketAPI mbed

Revision:
44:d7c5a56450a1
Parent:
43:932c5ddd7860
Child:
46:cf5ab96729e1
--- a/main.cpp	Fri Feb 26 17:30:00 2016 +0000
+++ b/main.cpp	Fri Feb 26 17:40:48 2016 +0000
@@ -15,14 +15,14 @@
  */
 
 #include "mbed.h"
-#include "ESP8266Interface.h"
+#include "LWIPInterface.h"
 #include "TCPSocket.h"
 
 DigitalOut myled(LED_GREEN);
 void flash(){ myled = !myled; }
 
-//LWIPInterface wifi(D1, D0);
-TCPSocket socket(0); // TODO
+LWIPInterface eth;
+TCPSocket socket(&eth); // TODO
 
 int main()
 {
@@ -30,10 +30,10 @@
     t.attach(flash, 0.4f);
     printf("NetworkSocketAPI Example\r\n");
 
-    wifi.connect("ssid", "password");
+    eth.connect();
     
-    const char *ip = wifi.getIPAddress();
-    const char *mac = wifi.getMACAddress();
+    const char *ip = eth.getIPAddress();
+    const char *mac = eth.getMACAddress();
     printf("IP Address is: %s\r\n", (ip) ? ip : "No IP");
     printf("MAC Address is: %s\r\n", (mac) ? mac : "No MAC");
 
@@ -45,7 +45,7 @@
     size = socket.recv(recieved, sizeof(recieved));
 
     socket.close();
-    wifi.disconnect();
+    eth.disconnect();
 
     printf("Recieved: %ld bytes, %02x%02x%02x%02x\r\n", size,
             recieved[0], recieved[1], recieved[2], recieved[3]);