
Simple app demonstrating the HTTP GET feature of the WiConnect Host Library.
Revision 13:32538c7842e6, committed 2014-11-27
- Comitter:
- dan_ackme
- Date:
- Thu Nov 27 10:29:35 2014 +0000
- Parent:
- 12:106e10b527f9
- Commit message:
- updated for latest wiconnect
Changed in this revision
WiConnect.lib | Show annotated file Show diff for this revision Revisions of this file |
example.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/WiConnect.lib Thu Nov 27 00:00:08 2014 -0800 +++ b/WiConnect.lib Thu Nov 27 10:29:35 2014 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/teams/ACKme/code/WiConnect/#2d7ef60a9f2a +http://mbed.org/teams/ACKme/code/WiConnect/#5ee74d72efe4
--- a/example.cpp Thu Nov 27 00:00:08 2014 -0800 +++ b/example.cpp Thu Nov 27 10:29:35 2014 +0000 @@ -19,7 +19,7 @@ */ // the URL of the webpage to GET -#define HTTP_URL "http://ack.me" +#define HTTP_URL "http://mbed.org" @@ -55,6 +55,8 @@ */ int main(int argc, char **argv) { + WiconnectResult result; + consoleSerial.baud(115200); // console terminal to 115200 baud //------------------------------------------------------------------------- @@ -81,12 +83,12 @@ printf("Initializing WiConnect Library...\r\n"); // Initialize communication with WiFi module - if(wiconnect.init(true) != WICONNECT_SUCCESS) + if(WICONNECT_FAILED(result, wiconnect.init(true))) { if(result == WICONNECT_FIRMWARE_OUTDATED) { - printf("The WiFi firmware is not supported. Run the ota example to update the firmware:\r\n"); - printf("https://developer.mbed.org/teams/ACKme/code/wiconnect-ota_example"); + printf("** The WiFi firmware is not supported. Run the ota example to update the firmware:\r\n"); + printf("https://developer.mbed.org/teams/ACKme/code/wiconnect-ota_example\r\n\r\n"); } else { @@ -113,6 +115,8 @@ if(wiconnect.httpGet(socket, HTTP_URL) != WICONNECT_SUCCESS) { printf("Failed to issue HTTP request. Does the module have valid network credentials?\r\n"); + printf("Use the network join example to configure the module's network credentials:\r\n"); + printf("https://developer.mbed.org/teams/ACKme/code/wiconnect-join_example\r\n"); for(;;); // infinite loop }