Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: HTTPClient WIZ820ioInterface mbed
Fork of HTTPClient_HelloWorld by
Revision 3:242eb9cf2b1e, committed 2013-12-01
- Comitter:
- ban4jp
- Date:
- Sun Dec 01 16:18:57 2013 +0000
- Parent:
- 2:270e2d0bb85a
- Child:
- 4:ca8e9930ba4e
- Child:
- 5:dce35de805b5
- Commit message:
- Update library (01 Dec 2013); Fix: Add a call inspection
Changed in this revision
--- a/EthernetInterface.lib Thu Aug 30 15:42:06 2012 +0000 +++ b/EthernetInterface.lib Sun Dec 01 16:18:57 2013 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/EthernetInterface/#a0ee3ae75cfa +http://mbed.org/users/mbed_official/code/EthernetInterface/#cba86db5ab96
--- a/main.cpp Thu Aug 30 15:42:06 2012 +0000
+++ b/main.cpp Sun Dec 01 16:18:57 2013 +0000
@@ -8,13 +8,33 @@
int main()
{
- eth.init(); //Use DHCP
+ int ret = eth.init(); //Use DHCP
+ if (!ret)
+ {
+ printf("Initialized, MAC: %s\n", eth.getMACAddress());
+ }
+ else
+ {
+ printf("Error eth.init() - ret = %d\n", ret);
+ return -1;
+ }
- eth.connect();
+ ret = eth.connect();
+ if (!ret)
+ {
+ printf("Connected, IP: %s, MASK: %s, GW: %s\n",
+ eth.getIPAddress(), eth.getNetworkMask(), eth.getGateway());
+ }
+ else
+ {
+ printf("Error eth.connect() - ret = %d\n", ret);
+ return -1;
+ }
+
//GET data
printf("\nTrying to fetch page...\n");
- int ret = http.get("http://mbed.org/media/uploads/donatien/hello.txt", str, 128);
+ ret = http.get("http://mbed.org/media/uploads/donatien/hello.txt", str, 128);
if (!ret)
{
printf("Page fetched successfully - read %d characters\n", strlen(str));
@@ -72,7 +92,18 @@
printf("Error - ret = %d - HTTP return code = %d\n", ret, http.getHTTPResponseCode());
}
- eth.disconnect();
+
+ printf("\n");
+ ret = eth.disconnect();
+ if (!ret)
+ {
+ printf("Disconnect\n");
+ }
+ else
+ {
+ printf("Error eth.disconnect() - ret = %d\n", ret);
+ }
+
while(1) {
}
--- a/mbed-rtos.lib Thu Aug 30 15:42:06 2012 +0000 +++ b/mbed-rtos.lib Sun Dec 01 16:18:57 2013 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed-rtos/#9654a71f5a90 +http://mbed.org/users/mbed_official/code/mbed-rtos/#29007aef10a4
--- a/mbed.bld Thu Aug 30 15:42:06 2012 +0000 +++ b/mbed.bld Sun Dec 01 16:18:57 2013 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/976df7c37ad5 \ No newline at end of file +http://mbed.org/users/mbed_official/code/mbed/builds/673126e12c73 \ No newline at end of file
