Dependencies:   NetServices mbed

Files at this revision

API Documentation at this revision

Comitter:
segundo
Date:
Tue Nov 09 21:28:45 2010 +0000
Child:
1:57f922fe8fb5
Commit message:

Changed in this revision

NetServices.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.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/NetServices.lib	Tue Nov 09 21:28:45 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/segundo/code/NetServices/#ac1725ba162c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Nov 09 21:28:45 2010 +0000
@@ -0,0 +1,28 @@
+#include "mbed.h"
+#include "EthernetNetIf.h"
+#include "HTTPClient.h"
+
+EthernetNetIf eth("mbedSE");
+HTTPClient http;
+
+int main() {
+
+    printf("Setting up...\n");
+    EthernetErr ethErr = eth.setup();
+    if (ethErr) {
+        printf("Error %d in setup\n", ethErr);
+        return -1;
+    }
+
+    printf("Connected ok, IP : %d.%d.%d.%d\n", eth.getIp()[0], eth.getIp()[1], eth.getIp()[2], eth.getIp()[3]);
+
+    HTTPText txt;
+    HTTPResult r = http.get("http://mbed.org/media/uploads/donatien/hello.txt", &txt);
+    if (r==HTTP_OK) {
+        printf("Result ok : %s\n", txt.gets());
+    } else {
+        printf("Error %d\n", r);
+    }
+
+    return 0;
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Nov 09 21:28:45 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/e2ac27c8e93e