ACKme
/
wiconnect-join_example
Simple app demonstrating network join feature of WiConnect Host Library.
Diff: example.cpp
- Revision:
- 17:218e96a88188
- Parent:
- 16:03409d4f1643
--- 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 {