demo of the murata wifi chip. This demo tries to connect to an open wifi access point and prints out all the relevant information about the connection. It then scans all wifi access points nearby and reports their information.

Dependencies:   SNICInterface mbed-rtos mbed

Fork of SNIC-xively-jumpstart-demo by muRata

Revision:
20:f0c7f5ca7e8a
Parent:
19:4e2900daad59
Child:
21:25b85cbbdd82
--- a/main.cpp	Thu Jun 19 10:16:36 2014 +0000
+++ b/main.cpp	Wed Jun 25 08:08:56 2014 +0000
@@ -22,8 +22,6 @@
 #include "logo.h"
 
 #define DEMO_AP_SSID                  "E2N1-Lab-Buffalo-D302"
-//#define DEMO_AP_SECURITY_TYPE         e_SEC_OPEN
-//#define DEMO_AP_SECUTIRY_KEY          ""
 #define DEMO_AP_SECURITY_TYPE         e_SEC_WPA2_AES
 #define DEMO_AP_SECUTIRY_KEY          "12345678"
 #define DEMO_AP_SECUTIRY_KEY_LEN      8
@@ -50,8 +48,14 @@
         lcd_printf( "Could not initialise. Will halt!\n" );        
         return -1;
     }    
-    
+    wait(0.5);
+    s = mSNICwifi.disconnect();
     lcd_printf("disconnect();\r\n");
+    if( s != 0 )
+    {
+        printf( "disconnect failed\r\n" );        
+        return -1;
+    }    
     
     wait(0.3);
     // Connect AP
@@ -100,7 +104,6 @@
     }
 
     while(1) {
-      
       switch( axl.getSide() ) {
         case MMA7660::Front:
           xi_set_value_str( current_side_rotation, "front" );