davide carboni / Mbed 2 deprecated HTTPClientExample

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
dadaista
Date:
Mon Jul 26 15:00:51 2010 +0000
Commit message:

Changed in this revision

EthernetNetIf.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
HTTPClientExample.cpp 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/EthernetNetIf.lib	Mon Jul 26 15:00:51 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/donatien/code/EthernetNetIf/#bc7df6da7589
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/HTTPClient.lib	Mon Jul 26 15:00:51 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/donatien/code/HTTPClient/#d97a4fc01c86
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/HTTPClientExample.cpp	Mon Jul 26 15:00:51 2010 +0000
@@ -0,0 +1,53 @@
+#include "mbed.h"
+#include "EthernetNetIf.h"
+#include "HTTPClient.h"
+
+//EthernetNetIf eth; 
+HTTPClient http;
+DigitalOut led1(LED1);
+DigitalOut led2(LED4);
+  
+int main() {
+
+  printf("Setting up...\n");
+
+  EthernetNetIf eth(
+  IpAddr(10,0,0,20), //IP Address
+  IpAddr(255,0,0,0), //Network Mask
+  IpAddr(10,0,0,1), //Gateway
+  IpAddr(10,0,0,1)  //DNS
+   );
+
+
+  EthernetErr ethErr = eth.setup();
+  if(ethErr)
+  {
+    printf("Error %d in setup.\n", ethErr);
+    return -1;
+  }
+  printf("Setup OK\n");
+  
+  HTTPText txt;
+  
+  HTTPResult r = http.get("http://10.0.0.1/", &txt);
+  if(r==HTTP_OK)
+  {
+    printf("GET Result :\"%s\"\n", txt.gets()); 
+    led1=1;
+    led2=1;
+  }
+  else
+  {
+    printf("Error %d\n", r);
+    led1=0;
+    led2=1;
+  }
+  
+  while(1)
+  {
+    //printf("ciao");
+  }
+  
+  return 0;
+  
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Jul 26 15:00:51 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/9114680c05da