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:
22:a9ec0cad4f84
Parent:
16:6100acfeb1f1
Child:
24:987e412ae879
--- a/SNIC_WifiInterface.cpp	Thu Mar 27 07:14:21 2014 +0000
+++ b/SNIC_WifiInterface.cpp	Thu Mar 27 07:37:55 2014 +0000
@@ -36,14 +36,14 @@
 
     /* Initialize SNIC API */
     // Get buffer for response payload from MemoryPool
-    tagMEMPOOL_BLOCK_T *payload_buf = mSNICWifi_p->allocCmdBuf();
+    C_SNIC_Core::tagMEMPOOL_BLOCK_T *payload_buf = mSNICWifi_p->allocCmdBuf();
     if( payload_buf == NULL )
     {
         printf("snic_init payload_buf NULL\r\n");
         return -1;
     }
 
-    tagSNIC_INIT_REQ_T req;
+    C_SNIC_Core::tagSNIC_INIT_REQ_T req;
     // Make request
     req.cmd_sid  = UART_CMD_SID_SNIC_INIT_REQ;
     req.seq      = mUartRequestSeq++;
@@ -53,7 +53,7 @@
     unsigned int  command_len;
     // Preparation of command
     command_len = mSNICWifi_p->preparationSendCommand( UART_CMD_ID_SNIC, req.cmd_sid, (unsigned char *)&req
-                            , sizeof(tagSNIC_INIT_REQ_T), payload_buf->buf, command_array );
+                            , sizeof(C_SNIC_Core::tagSNIC_INIT_REQ_T), payload_buf->buf, command_array );
 
     // Send uart command request
     mSNICWifi_p->sendUart( command_len, command_array );
@@ -83,14 +83,14 @@
     C_SNIC_UartCommandManager *uartCmdMgr_p = mSNICWifi_p->getUartCommand();
     
     // Get buffer for response payload from MemoryPool
-    tagMEMPOOL_BLOCK_T *payload_buf = mSNICWifi_p->allocCmdBuf();
+    C_SNIC_Core::tagMEMPOOL_BLOCK_T *payload_buf = mSNICWifi_p->allocCmdBuf();
     if( payload_buf == NULL )
     {
         printf("getFWVersion payload_buf NULL\r\n");
         return -1;
     }
 
-    tagGEN_FW_VER_GET_REQ_T req;
+    C_SNIC_Core::tagGEN_FW_VER_GET_REQ_T req;
     // Make request
     req.cmd_sid = UART_CMD_SID_GEN_FW_VER_GET_REQ;
     req.seq     = mUartRequestSeq++;
@@ -99,7 +99,7 @@
     unsigned int  command_len;
     // Preparation of command
     command_len = mSNICWifi_p->preparationSendCommand( UART_CMD_ID_GEN, req.cmd_sid, (unsigned char *)&req
-                        , sizeof(tagGEN_FW_VER_GET_REQ_T), payload_buf->buf, command_array );
+                        , sizeof(C_SNIC_Core::tagGEN_FW_VER_GET_REQ_T), payload_buf->buf, command_array );
 
     int ret;
     
@@ -144,7 +144,7 @@
     }
     
     // Get buffer for response payload from MemoryPool
-    tagMEMPOOL_BLOCK_T *payload_buf = mSNICWifi_p->allocCmdBuf();
+    C_SNIC_Core::tagMEMPOOL_BLOCK_T *payload_buf = mSNICWifi_p->allocCmdBuf();
     if( payload_buf == NULL )
     {
         printf("connect payload_buf NULL\r\n");
@@ -215,14 +215,14 @@
     C_SNIC_UartCommandManager *uartCmdMgr_p = mSNICWifi_p->getUartCommand();
     
     // Get buffer for response payload from MemoryPool
-    tagMEMPOOL_BLOCK_T *payload_buf = mSNICWifi_p->allocCmdBuf();
+    C_SNIC_Core::tagMEMPOOL_BLOCK_T *payload_buf = mSNICWifi_p->allocCmdBuf();
     if( payload_buf == NULL )
     {
         printf("disconnect payload_buf NULL\r\n");
         return -1;
     }
 
-    tagWIFI_DISCONNECT_REQ_T req;
+    C_SNIC_Core::tagWIFI_DISCONNECT_REQ_T req;
     // Make request
     req.cmd_sid = UART_CMD_SID_WIFI_DISCONNECT_REQ;
     req.seq = mUartRequestSeq++;
@@ -231,7 +231,7 @@
     unsigned int  command_len;
     // Preparation of command
     command_len = mSNICWifi_p->preparationSendCommand( UART_CMD_ID_WIFI, req.cmd_sid, (unsigned char *)&req
-                        , sizeof(tagWIFI_DISCONNECT_REQ_T), payload_buf->buf, command_array );
+                        , sizeof(C_SNIC_Core::tagWIFI_DISCONNECT_REQ_T), payload_buf->buf, command_array );
 
     // Send uart command request
     mSNICWifi_p->sendUart( command_len, command_array );
@@ -261,17 +261,17 @@
     C_SNIC_UartCommandManager *uartCmdMgr_p = mSNICWifi_p->getUartCommand();
 
     // Get buffer for response payload from MemoryPool
-    tagMEMPOOL_BLOCK_T *payload_buf = mSNICWifi_p->allocCmdBuf();
+    C_SNIC_Core::tagMEMPOOL_BLOCK_T *payload_buf = mSNICWifi_p->allocCmdBuf();
     if( payload_buf == NULL )
     {
         printf("scan payload_buf NULL\r\n");
         return -1;
     }
     
-    tagWIFI_SCAN_REQ_T req;
+    C_SNIC_Core::tagWIFI_SCAN_REQ_T req;
     unsigned int  buf_len = 0;
     
-    memset( &req, 0, sizeof(tagWIFI_SCAN_REQ_T) );
+    memset( &req, 0, sizeof(C_SNIC_Core::tagWIFI_SCAN_REQ_T) );
     // Make request
     req.cmd_sid = UART_CMD_SID_WIFI_SCAN_REQ;
     buf_len++;
@@ -347,14 +347,14 @@
     }
     
     // Get buffer for response payload from MemoryPool
-    tagMEMPOOL_BLOCK_T *payload_buf = mSNICWifi_p->allocCmdBuf();
+    C_SNIC_Core::tagMEMPOOL_BLOCK_T *payload_buf = mSNICWifi_p->allocCmdBuf();
     if( payload_buf == NULL )
     {
         printf("wifi_on payload_buf NULL\r\n");
         return -1;
     }
 
-    tagWIFI_ON_REQ_T req;
+    C_SNIC_Core::tagWIFI_ON_REQ_T req;
     // Make request
     req.cmd_sid = UART_CMD_SID_WIFI_ON_REQ;
     req.seq = mUartRequestSeq++;
@@ -364,7 +364,7 @@
     unsigned int  command_len;
     // Preparation of command
     command_len = mSNICWifi_p->preparationSendCommand( UART_CMD_ID_WIFI, req.cmd_sid, (unsigned char *)&req
-                        , sizeof(tagWIFI_ON_REQ_T), payload_buf->buf, command_array );
+                        , sizeof(C_SNIC_Core::tagWIFI_ON_REQ_T), payload_buf->buf, command_array );
 
     // Send uart command request
     mSNICWifi_p->sendUart( command_len, command_array );
@@ -394,14 +394,14 @@
     C_SNIC_UartCommandManager *uartCmdMgr_p = mSNICWifi_p->getUartCommand();
 
     // Get buffer for response payload from MemoryPool
-    tagMEMPOOL_BLOCK_T *payload_buf = mSNICWifi_p->allocCmdBuf();
+    C_SNIC_Core::tagMEMPOOL_BLOCK_T *payload_buf = mSNICWifi_p->allocCmdBuf();
     if( payload_buf == NULL )
     {
         printf("wifi_off payload_buf NULL\r\n");
         return -1;
     }
 
-    tagWIFI_OFF_REQ_T req;
+    C_SNIC_Core::tagWIFI_OFF_REQ_T req;
     // Make request
     req.cmd_sid = UART_CMD_SID_WIFI_OFF_REQ;
     req.seq = mUartRequestSeq++;
@@ -410,7 +410,7 @@
     unsigned int  command_len;
     // Preparation of command
     command_len = mSNICWifi_p->preparationSendCommand( UART_CMD_ID_WIFI, req.cmd_sid, (unsigned char *)&req
-                        , sizeof(tagWIFI_OFF_REQ_T), payload_buf->buf, command_array );
+                        , sizeof(C_SNIC_Core::tagWIFI_OFF_REQ_T), payload_buf->buf, command_array );
 
     // Send uart command request
     mSNICWifi_p->sendUart( command_len, command_array );
@@ -445,14 +445,14 @@
     }
     
     // Get buffer for response payload from MemoryPool
-    tagMEMPOOL_BLOCK_T *payload_buf = mSNICWifi_p->allocCmdBuf();
+    C_SNIC_Core::tagMEMPOOL_BLOCK_T *payload_buf = mSNICWifi_p->allocCmdBuf();
     if( payload_buf == NULL )
     {
         printf("getRssi payload_buf NULL\r\n");
         return -1;
     }
 
-    tagWIFI_GET_STA_RSSI_REQ_T req;
+    C_SNIC_Core::tagWIFI_GET_STA_RSSI_REQ_T req;
     
     // Make request
     req.cmd_sid = UART_CMD_SID_WIFI_GET_STA_RSSI_REQ;
@@ -461,7 +461,7 @@
     unsigned char  command_array[UART_REQUEST_PAYLOAD_MAX];
     unsigned int   command_len;
     command_len = mSNICWifi_p->preparationSendCommand( UART_CMD_ID_WIFI, req.cmd_sid, (unsigned char *)&req
-                        , sizeof(tagWIFI_GET_STA_RSSI_REQ_T), payload_buf->buf, command_array );
+                        , sizeof(C_SNIC_Core::tagWIFI_GET_STA_RSSI_REQ_T), payload_buf->buf, command_array );
 
     int ret;
     // Send uart command request
@@ -493,14 +493,14 @@
     }
     
     // Get buffer for response payload from MemoryPool
-    tagMEMPOOL_BLOCK_T *payload_buf = mSNICWifi_p->allocCmdBuf();
+    C_SNIC_Core::tagMEMPOOL_BLOCK_T *payload_buf = mSNICWifi_p->allocCmdBuf();
     if( payload_buf == NULL )
     {
         printf("getWifiStatus payload_buf NULL\r\n");
         return -1;
     }
 
-    tagWIFI_GET_STATUS_REQ_T req;
+    C_SNIC_Core::tagWIFI_GET_STATUS_REQ_T req;
     // Make request
     req.cmd_sid = UART_CMD_SID_WIFI_GET_STATUS_REQ;
     req.seq     = mUartRequestSeq++;
@@ -509,7 +509,7 @@
     unsigned char  command_array[UART_REQUEST_PAYLOAD_MAX];
     unsigned int   command_len;
     command_len = mSNICWifi_p->preparationSendCommand( UART_CMD_ID_WIFI, req.cmd_sid, (unsigned char *)&req
-                        , sizeof(tagWIFI_GET_STATUS_REQ_T), payload_buf->buf, command_array );
+                        , sizeof(C_SNIC_Core::tagWIFI_GET_STATUS_REQ_T), payload_buf->buf, command_array );
 
     // Send uart command request
     mSNICWifi_p->sendUart( command_len, command_array );