FlashAir Developers Summit OSAKA 2019 handson step2

Dependencies:   mbed ADT7410 FlashAir_iSDIO SDFileSystem USBDevice

Files at this revision

API Documentation at this revision

Comitter:
hogejun
Date:
Tue Jan 15 14:15:16 2019 +0000
Parent:
5:7ade87f735a2
Child:
7:c2097153ff5c
Commit message:
cleanup

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Tue Jan 15 08:03:46 2019 +0000
+++ b/main.cpp	Tue Jan 15 14:15:16 2019 +0000
@@ -45,11 +45,11 @@
 //-------------------------------------------------------------------------------
 //Program
 
-int wlan_stat = 0;
+int wlan_connected = 0;
 uint32_t sequenceId ;
 
 void sw_int(){
-    if(wlan_stat==1){
+    if(wlan_connected==1){
         // disconnect 
         // 1. get sequenceID
         // 2. issue disconnect command
@@ -57,7 +57,7 @@
         sequenceId = sd.getNextSequenceId();
         sd.wlan_disconnect(sequenceId);
         sd.waitResponse(sequenceId);
-        wlan_stat =0;
+        wlan_connected =0;
         led1 = 0;
         wait(5.0);
     }else{
@@ -67,8 +67,9 @@
         // 3. wait resoonse        
         sequenceId = sd.getNextSequenceId();
         sd.wlan_establish(sequenceId, "isdiotest", "12345678", FlashAir_iSDIO::ENCMODE_WPA2PSK_AES);
+        sd.waitResponse(sequenceId);
         led1 = 1;
-        wlan_stat =1;
+        wlan_connected =1;
         wait(5.0);
     
     }