Dependencies:   EthernetNetIf mbed

Files at this revision

API Documentation at this revision

Comitter:
donatien
Date:
Thu Aug 05 12:40:24 2010 +0000
Parent:
0:21dd20de08d1
Child:
2:3034b64b0c3f
Commit message:

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Thu Aug 05 12:35:39 2010 +0000
+++ b/main.cpp	Thu Aug 05 12:40:24 2010 +0000
@@ -5,12 +5,8 @@
 EthernetNetIf eth;
 HTTPClient http;
 
-Serial pc(USBTX, USBRX);
-  
 int main() {
 
-//pc.baud(230400);
-
   printf("Setting up...\n");
   EthernetErr ethErr = eth.setup();
   if(ethErr)
@@ -20,37 +16,21 @@
   }
   printf("Setup OK\n");
   
-{
-
-  HTTPFile f("/sd/m.pdf");
-  
-  HTTPResult r = http.get("http://mbed.org/media/press/mbed_whitepaper.pdf", &f);
-
+  {
 
-/*
-  HTTPFile f("/sd/image.png");
-  
-  HTTPResult r = http.get("http://mbed.org/media/press/images/mbed-logo-blue.png", &f);
-*/
-
- // HTTPFile f("/local/test2.txt");
-// HTTPText f;
+    HTTPFile f("/sd/m.pdf");
   
-  
-  //http.setRequestHeader("User-Agent","mbed");
-  //http.setRequestHeader("Accept","*/*");
-  
-  //HTTPResult r = http.get("http://en.wikipedia.org/wiki/Transmission_Control_Protocol", &f);
-  
-  if(r==HTTP_OK)
-  {
-    printf("Result OK\n"); 
-  }
-  else
-  {
-    printf("Error %d\n", r);
-  }
-}  
+    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)
   {