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:
3:9f90024d7fb2
Parent:
2:0ba43344c814
Child:
5:ef3befe3edad
--- a/YDwifi/YDwifiUartCommand.h	Tue Mar 11 10:38:36 2014 +0000
+++ b/YDwifi/YDwifiUartCommand.h	Thu Mar 13 01:34:56 2014 +0000
@@ -5,16 +5,40 @@
 
 namespace murata_wifi
 {
+/** Max length of SSID */
+#define SSID_MAX_LENGTH 32
+/** Max length of BSSID */
+#define BSSID_MAC_LENTH 6
     
 /** Wait signal ID of UART command */
 #define UART_COMMAND_SIGNAL        0x00000001
 /** Timeout of UART command wait(ms)*/
 #define UART_COMMAND_WAIT_TIMEOUT  10000
 
+/** Scan result 
+*/
+typedef struct {
+    /** Channel */
+    unsigned char channel;
+    /** RSSI */
+    signed   char rssi;
+    /** Security type */
+    unsigned char security;
+    /** BSSID */
+    unsigned char bssid[BSSID_MAC_LENTH];
+    /** Network type */
+    unsigned char network_type;
+    /** Max data rate */
+    unsigned char max_rate;
+    /** SSID */
+    char          ssid[SSID_MAX_LENGTH+1];
+}tagSCAN_RESULT_T;
+
+/** C_YDwifiUartCommand class
+ */
 class C_YDwifiUartCommand
 {
 public:
-
     /** Set Command ID
         @param cmd_id Command ID
     */
@@ -54,6 +78,13 @@
         @return Pointer of response buffer
     */
     unsigned char *getResponseBuf();
+
+    /** Set scan result callback hander
+        @param handler_p Pointer of callback function
+    */
+    void setScanResultHandler( void (*handler_p)(tagSCAN_RESULT_T *scan_result) );
+    
+    void scanResultIndicate( unsigned char *payload_p, int payload_len );
     
     /** Checks in the command which is waiting from Command ID and Sub ID.
         @param  command_id  Command ID
@@ -77,6 +108,8 @@
     unsigned char mCommandStatus;
     /** ResponseData of command response */
     unsigned char *mResponseBuf_p;
+    /** Scan result handler */
+    void (*mScanResultHandler_p)(tagSCAN_RESULT_T *scan_result);
 };
     
 }