Dependencies:   EthernetInterface mbed-rtos mbed wiflash

Fork of TCPSocket_HelloWorld by mbed official

Files at this revision

API Documentation at this revision

Comitter:
adhithyan15
Date:
Thu Apr 30 23:58:32 2015 +0000
Parent:
15:69e41cbbc8ac
Commit message:
Wiflash demo program

Changed in this revision

EthernetInterface.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-rtos.lib Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
wiflash.lib Show annotated file Show diff for this revision Revisions of this file
diff -r 69e41cbbc8ac -r 7735da154f2f EthernetInterface.lib
--- a/EthernetInterface.lib	Sun Sep 21 05:55:13 2014 +0000
+++ b/EthernetInterface.lib	Thu Apr 30 23:58:32 2015 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/EthernetInterface/#5887ae6c0c2c
+http://mbed.org/users/mbed_official/code/EthernetInterface/#2fc406e2553f
diff -r 69e41cbbc8ac -r 7735da154f2f main.cpp
--- a/main.cpp	Sun Sep 21 05:55:13 2014 +0000
+++ b/main.cpp	Thu Apr 30 23:58:32 2015 +0000
@@ -1,31 +1,11 @@
 #include "mbed.h"
 #include "EthernetInterface.h"
+#include "wiflash.h" // Include our wiflash library
+
+Wiflash wf; // Pass in a reference to the Ethernet interface object to the Wiflash object
+
 
 int main() {
-    EthernetInterface eth;
-    eth.init(); //Use DHCP
-    eth.connect();
-    printf("IP Address is %s\n", eth.getIPAddress());
-    
-    TCPSocketConnection sock;
-    sock.connect("mbed.org", 80);
-    
-    char http_cmd[] = "GET /media/uploads/mbed_official/hello.txt HTTP/1.0\n\n";
-    sock.send_all(http_cmd, sizeof(http_cmd)-1);
-    
-    char buffer[300];
-    int ret;
-    while (true) {
-        ret = sock.receive(buffer, sizeof(buffer)-1);
-        if (ret <= 0)
-            break;
-        buffer[ret] = '\0';
-        printf("Received %d chars from server:\n%s\n", ret, buffer);
-    }
-      
-    sock.close();
-    
-    eth.disconnect();
-    
-    while(1) {}
+    wf.setUp();
+    printf("Inside main!\n");
 }
diff -r 69e41cbbc8ac -r 7735da154f2f mbed-rtos.lib
--- a/mbed-rtos.lib	Sun Sep 21 05:55:13 2014 +0000
+++ b/mbed-rtos.lib	Thu Apr 30 23:58:32 2015 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed-rtos/#631c0f1008c3
+http://mbed.org/users/mbed_official/code/mbed-rtos/#34292fba723c
diff -r 69e41cbbc8ac -r 7735da154f2f mbed.bld
--- a/mbed.bld	Sun Sep 21 05:55:13 2014 +0000
+++ b/mbed.bld	Thu Apr 30 23:58:32 2015 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/552587b429a1
\ No newline at end of file
+http://mbed.org/users/mbed_official/code/mbed/builds/433970e64889
\ No newline at end of file
diff -r 69e41cbbc8ac -r 7735da154f2f wiflash.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wiflash.lib	Thu Apr 30 23:58:32 2015 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/users/adhithyan15/code/wiflash/#6b372eb53d67