by Rob Toulson and Tim Wilmshurst from textbook "Fast and Effective Embedded Systems Design: Applying the ARM mbed"
Revision 0:6dbcb68a18e4, committed 2013-06-16
- Comitter:
- robt
- Date:
- Sun Jun 16 15:32:31 2013 +0000
- Commit message:
- by Rob Toulson and Tim Wilmshurst from textbook "Fast and Effective Embedded Systems Design: Applying the ARM mbed"
Changed in this revision
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 |
diff -r 000000000000 -r 6dbcb68a18e4 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun Jun 16 15:32:31 2013 +0000 @@ -0,0 +1,22 @@ +/* Program Example 12.9: mbed HTTP client test + */ +#include "mbed.h" +#include "EthernetNetIf.h" +#include "HTTPClient.h" +EthernetNetIf eth( + IpAddr(192,168,0,101), //IP Address + IpAddr(255,255,255,0), //Network Mask + IpAddr(192,168,0,1), //Gateway + IpAddr(192,168,0,1) //DNS +); +HTTPClient http; +HTTPText txt; +Serial pc (USBTX,USBRX) ; +int main() { + pc.printf("\r\nSetting up network connection...\n\r"); + eth.setup(); + pc.printf("\r\nSetup OK. Queerying data...\r\n"); + // attempt to access file ‘mbedclienttest.txt’ through the internet... + HTTPResult r=http.get("http://www.rt60.co.uk/mbed/mbedclienttest.txt", &txt); + pc.printf("Result :\n\r\"%s\"\n\r", txt.gets()); +}
diff -r 000000000000 -r 6dbcb68a18e4 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sun Jun 16 15:32:31 2013 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/b3110cd2dd17 \ No newline at end of file