ban4jp - / SNICInterface_PullReq

Dependents:   SNIC-httpclient-example SNIC-ntpclient-example

Fork of SNICInterface by muRata

Revision:
3:9f90024d7fb2
Parent:
2:0ba43344c814
Child:
5:ef3befe3edad
--- a/YDwifiInterface.h	Tue Mar 11 10:38:36 2014 +0000
+++ b/YDwifiInterface.h	Thu Mar 13 01:34:56 2014 +0000
@@ -6,9 +6,10 @@
 namespace murata_wifi
 {
 
+/** C_YDwifiInterface class
+ */
 class C_YDwifiInterface: public C_YDwifi {
 public:
-
     /** Constructor
         @param tx mbed pin to use for tx line of Serial interface
         @param rx mbed pin to use for rx line of Serial interface
@@ -33,23 +34,40 @@
     */
     int getFWVersion( unsigned char *version_p );
 
-#if 0
-  /** Connect
-  * Bring the interface up, start DHCP if needed.
-  * \param sec the Wi-Fi security type
-  * \param ssid the Wi-Fi SSID
-  * \param phrase the Wi-Fi passphrase or security key
-  * \param mode the Wi-Fi mode
-  * \return 0 on success, a negative number on failure
-  */
-  int connect(Security sec, const char* ssid, const char* phrase, WiFiMode mode = WM_INFRASTRUCTURE);
+    /** Connect to AP
+        @param ssid_p       Wi-Fi SSID(null terminated)
+        @param ssid_len     Wi-Fi SSID length
+        @param sec_type     Wi-Fi security type.
+        @param sec_key_len  Wi-Fi passphrase or security key length
+        @param sec_key_p    Wi-Fi passphrase or security key
+        @return 0 on success, a negative number on failure
+        @note   This function is blocked until a returns.
+                When you use it by UI thread, be careful. 
+    */
+    int connect(const char *ssid_p, unsigned char ssid_len, E_SECURITY sec_type, const char *sec_key_p, unsigned char sec_key_len);
   
-  /** Disconnect
-  * Bring the interface down
-  * \return 0 on success, a negative number on failure
-  */
-  int disconnect();
-  
+    /** Disconnect from AP
+        @return 0 on success, a negative number on failure
+        @note   This function is blocked until a returns.
+                When you use it by UI thread, be careful. 
+    */
+    int disconnect();
+
+    /** Scan AP
+        @param  ssid_p  Wi-Fi SSID(null terminated)
+                        If do not specify SSID, set to NULL.
+        @param  bssid_p Wi-Fi BSSID(null terminated)
+                        If do not specify SSID, set to NULL.
+        @param  result_handler_p Pointer of scan result callback function.
+        @return 0 on success, a negative number on failure
+        @note   This function is blocked until a returns.
+                When you use it by UI thread, be careful. 
+                Scan results will be notified by asynchronous callback function.
+    */
+    int scan( const char *ssid_p, unsigned char *bssid_p
+            ,void (*result_handler_p)(tagSCAN_RESULT_T *scan_result) );
+
+#if 0  
   /** Get the MAC address of your Ethernet interface
    * \return a pointer to a string containing the MAC address
    */
@@ -72,5 +90,4 @@
 #endif
 };
 }
-
 #endif  /* _YD_WIFIINTERFACE_H_ */
\ No newline at end of file