Simple app demonstrating the HTTP GET feature of the WiConnect Host Library.

Dependencies:   WiConnect mbed

Revision:
13:32538c7842e6
Parent:
12:106e10b527f9
--- 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
     }