Dependencies:   EthernetNetIf mbed

Files at this revision

API Documentation at this revision

Comitter:
nenad
Date:
Tue Apr 10 14:52:44 2012 +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	Tue Apr 10 14:52:44 2012 +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	Tue Apr 10 14:52:44 2012 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/donatien/code/HTTPClient/#d0be6af2d1db
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/HTTPClientExample.cpp	Tue Apr 10 14:52:44 2012 +0000
@@ -0,0 +1,45 @@
+#include "mbed.h"
+#include "EthernetNetIf.h"
+#include "HTTPClient.h"
+
+EthernetNetIf eth;
+/*EthernetNetIf eth(
+  IpAddr(192,168,0,110), //IP Address
+  IpAddr(255,255,255,0), //Network Mask
+  IpAddr(192,168,0,1), //Gateway
+  IpAddr(192,168,0,1)  //DNS
+);*/
+
+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");
+  
+  HTTPText txt;
+  
+  HTTPResult r = http.get("http://tnt.etf.rs/~oe4irs/pmk.txt", &txt);
+  if(r==HTTP_OK)
+  {
+    printf("Result :\"%s\"\n", txt.gets()); 
+  }
+  else
+  {
+    printf("Error %d\n", r);
+  }
+  
+  while(1)
+  {
+  
+  }
+  
+  return 0;
+  
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Apr 10 14:52:44 2012 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/9114680c05da