ACKme
/
wiconnect-join_example
Simple app demonstrating network join feature of WiConnect Host Library.
Diff: example.cpp
- Revision:
- 11:d4a23c59b13d
- Parent:
- 9:ba592b3a5c64
- Child:
- 13:8d2130a74442
--- a/example.cpp Tue Aug 26 23:55:18 2014 +0000 +++ b/example.cpp Sun Sep 07 02:15:17 2014 +0000 @@ -22,11 +22,11 @@ // Look for this name in your WiFi settings // (e.g. your phone's list of WiFi networks in the WiFi settings menu) // tip: add double-quotes around SSID to add spaces to name -#define NETWORK_SSID "\"<YOUR NETWORK NAME HERE>\"" +#define NETWORK_SSID "hackathon" // This is the password of your WiFi network // Leave as empty string (e.g "") to connect to OPEN network -#define NETWORK_PASSWORD "\"<YOUR NETWORK PASSWORD HERE>\"" +#define NETWORK_PASSWORD "" @@ -61,6 +61,7 @@ */ int main(int argc, char **argv) { + WiconnectResult result; consoleSerial.baud(115200); // console terminal to 115200 baud //------------------------------------------------------------------------- @@ -99,9 +100,9 @@ printf("Joining network: %s....\r\n", NETWORK_SSID); - if(wiconnect.join(NETWORK_SSID, NETWORK_PASSWORD) != WICONNECT_SUCCESS) + if(WICONNECT_FAILED(result, wiconnect.join(NETWORK_SSID, NETWORK_PASSWORD))) { - printf("Failed to send join command\r\n"); + printf("Failed to send join command: %d\r\n", result); for(;;); // infinite loop }