HTTP Client + SD Card example

Dependencies:   EthernetNetIf mbed SDFileSystem

Files at this revision

API Documentation at this revision

Comitter:
donatien
Date:
Fri Aug 06 11:16:59 2010 +0000
Commit message:

Changed in this revision

EthernetNetIf.lib Show annotated file Show diff for this revision Revisions of this file
FATFileSystem.lib Show annotated file Show diff for this revision Revisions of this file
HTTPClient.lib Show annotated file Show diff for this revision Revisions of this file
HTTPClientSDCardExample.cpp Show annotated file Show diff for this revision Revisions of this file
SDFileSystem.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
diff -r 000000000000 -r b29ef8c1a494 EthernetNetIf.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/EthernetNetIf.lib	Fri Aug 06 11:16:59 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/donatien/code/EthernetNetIf/#bc7df6da7589
diff -r 000000000000 -r b29ef8c1a494 FATFileSystem.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/FATFileSystem.lib	Fri Aug 06 11:16:59 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_unsupported/code/fatfilesystem/
\ No newline at end of file
diff -r 000000000000 -r b29ef8c1a494 HTTPClient.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/HTTPClient.lib	Fri Aug 06 11:16:59 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/donatien/code/HTTPClient/#d97a4fc01c86
diff -r 000000000000 -r b29ef8c1a494 HTTPClientSDCardExample.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/HTTPClientSDCardExample.cpp	Fri Aug 06 11:16:59 2010 +0000
@@ -0,0 +1,47 @@
+#include "mbed.h"
+
+#include "EthernetNetIf.h"
+
+#include "SDFileSystem.h"
+
+#include "HTTPClient.h"
+
+SDFileSystem sd(p5, p6, p7, p8, "sd"); //p9: SD present; p8: CS
+
+EthernetNetIf eth;
+HTTPClient http;
+
+int main() {
+
+  printf("Setting up...\n");
+  EthernetErr ethErr = eth.setup();
+  if(ethErr)
+  {
+    printf("Error %d in setup.\n", ethErr);
+    return -1;
+  }
+  printf("Setup OK\n");
+  
+  {
+
+    HTTPFile f("/sd/m.pdf");
+  
+    HTTPResult r = http.get("http://mbed.org/media/press/mbed_whitepaper.pdf", &f);
+
+    if(r==HTTP_OK)
+    {
+      printf("Result OK\n"); 
+    }
+    else
+    {
+      printf("Error %d\n", r);
+    }
+  }  
+  while(1)
+  {
+  
+  }
+  
+  return 0;
+  
+}
diff -r 000000000000 -r b29ef8c1a494 SDFileSystem.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SDFileSystem.lib	Fri Aug 06 11:16:59 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/simon/code/SDFileSystem/#b1ddfc9a9b25
diff -r 000000000000 -r b29ef8c1a494 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Aug 06 11:16:59 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/9114680c05da