SNIC UART Interface library: Serial to Wi-Fi library for Murata TypeYD Wi-Fi module. For more information about TypeYD: http://www.murata.co.jp/products/microwave/module/lbwb1zzydz/index.html

Dependents:   SNIC-xively-jumpstart-demo SNIC-FluentLogger-example TCPEchoServer murataDemo ... more

Fork of YDwifiInterface by Takao Kishino

Revision:
37:f3a2053627c2
Parent:
36:f33fcf5975ab
Child:
38:f13e4e563d65
diff -r f33fcf5975ab -r f3a2053627c2 SNIC_WifiInterface.cpp
--- a/SNIC_WifiInterface.cpp	Thu Jun 19 10:15:47 2014 +0000
+++ b/SNIC_WifiInterface.cpp	Tue Jun 24 06:24:23 2014 +0000
@@ -35,13 +35,13 @@
     C_SNIC_Core               *snic_core_p  = C_SNIC_Core::getInstance();
     C_SNIC_UartCommandManager *uartCmdMgr_p = snic_core_p->getUartCommand();
     
+    /* Initialize UART */
+    snic_core_p->initUart( mUART_tx, mUART_rx, mUART_baud );
+
     /* Module reset */
     snic_core_p->resetModule( mModuleReset );
     
-    /* Initialize UART */
-    snic_core_p->initUart( mUART_tx, mUART_rx, mUART_baud );
-
-    wait(0.5);
+    wait(1);
     /* Initialize SNIC API */
     // Get buffer for response payload from MemoryPool
     tagMEMPOOL_BLOCK_T *payload_buf = snic_core_p->allocCmdBuf();
@@ -210,7 +210,6 @@
         snic_core_p->freeCmdBuf( payload_buf );
         return -1;
     }
-    printf("join OK\r\n");
     
     if( (uartCmdMgr_p->getCommandStatus() != 0) && 
         (uartCmdMgr_p->getCommandStatus() != UART_CMD_RES_WIFI_ERR_ALREADY_JOINED) )
@@ -553,7 +552,7 @@
     } 
 
     // set SSID
-    if( ( status_p->status == e_STA_JOINED ) == ( status_p->status == e_AP_STARTED ) )
+    if( ( status_p->status == e_STA_JOINED ) || ( status_p->status == e_AP_STARTED ) )
     {
         memcpy( status_p->ssid, &payload_buf->buf[9], strlen( (char *)&payload_buf->buf[9]) );
     }