Simple app demonstrating network join feature of WiConnect Host Library.

Dependencies:   WiConnect mbed

Files at this revision

API Documentation at this revision

Comitter:
dan_ackme
Date:
Thu Nov 27 08:49:32 2014 +0000
Parent:
16:03409d4f1643
Child:
18:3cc75e940e23
Commit message:
updated to use latest wiconnect library

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:01:37 2014 -0800
+++ b/WiConnect.lib	Thu Nov 27 08:49:32 2014 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/teams/ACKme/code/WiConnect/#2d7ef60a9f2a
+http://mbed.org/teams/ACKme/code/WiConnect/#a30cbf4bdb13
--- a/example.cpp	Thu Nov 27 00:01:37 2014 -0800
+++ b/example.cpp	Thu Nov 27 08:49:32 2014 +0000
@@ -29,8 +29,6 @@
 #define NETWORK_PASSWORD "\"<YOUR NETWORK PASSWORD HERE>\""
 
 
-
-
 /******************************************************************************
  * Includes
  */
@@ -54,13 +52,13 @@
 static Serial consoleSerial(STDIO_UART_TX, STDIO_UART_RX);
 
 
-
-
 /******************************************************************************
  * Starting point of application
  */
 int main(int argc, char **argv)
 {
+    WiconnectResult result;
+    
     consoleSerial.baud(115200); // console terminal to 115200 baud
 
     //-------------------------------------------------------------------------
@@ -77,7 +75,6 @@
     // The internal buffer will be dynamically allocated
     Wiconnect wiconnect(serialConfig, 256, NULL, WICONNECT_RESET_PIN);
 
-
     //-------------------------------------------------------------------------
     // STEP 2: Initiate Communication with WiFi Module
     //-------------------------------------------------------------------------
@@ -85,12 +82,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
         {