GainSpan Wi-Fi library see: http://mbed.org/users/gsfan/notebook/gainspan_wifi/

Fork of GSwifi_old by gs fan

GainSpan Wi-Fi library

The GS1011 is an ultra low power 802.11b wireless module from GainSpan.

see: http://mbed.org/users/gsfan/notebook/gainspan_wifi/

Information

Please change the baud rate in advance.

  • ATB=115200
  • AT&W0

It may be better and sometimes faster.
GSwifi gs(p13, p14, baud);

Heavily modified new library: http://mbed.org/users/gsfan/code/GSwifi

ゲインスパン Wi-Fi モジュール ライブラリ

ゲインスパン社の低電力 Wi-Fiモジュール(無線LAN) GS1011 シリーズ用のライブラリです。

解説: http://mbed.org/users/gsfan/notebook/gainspan_wifi/

Information

モジュールはあらかじめ次のコマンドでボーレートを変更しておく。

  • ATB=115200
  • AT&W0

場合によってはもっと高速の方がいいかもしれない。クラス宣言時にレート設定をする。
GSwifi gs(p13, p14, baud);

大幅に更新された新しいライブラリ: http://mbed.org/users/gsfan/code/GSwifi

Revision:
2:c6e0e97901b3
Parent:
1:b127c6c5241d
Child:
4:a8d38857f3fd
--- a/GSwifi.h	Thu Jul 12 08:19:50 2012 +0000
+++ b/GSwifi.h	Thu Jul 12 13:36:04 2012 +0000
@@ -121,7 +121,6 @@
     /**
      * send command
      */
-
     int command (char *cmd, GSRESPONCE res, int timeout = GS_TIMEOUT);
     /**
      * recv responce
@@ -130,23 +129,33 @@
     /**
      * associate infrastructure
      * @param sec GSSEC_OPEN, GSSEC_WEP, GSSEC_WPA_PSK, GSSEC_WPA2_PSK, GSSEC_WPS_BUTTON
-     * @param ssid
-     * @param pass
+     * @param ssid SSID
+     * @param pass pass phrase
+     * @param dhcp 0:static ip, 1:dhcp
+     * @retval 0 success
+     * @retval -1 failure
      */
-
     int connect (GSSECURITY sec, char *ssid, char *pass, int dhcp = 1);
     /**
      * adhock
      * @param sec GSSEC_OPEN or GSSEC_WEP
-     * @param ssid
-     * @param pass
+     * @param ssid SSID
+     * @param pass 10 or 26 hexadecimal digits
+     * @param ipaddr my ip address
+     * @param netmask subnet mask
+     * @retval 0 success
+     * @retval -1 failure
      */
     int adhock (GSSECURITY sec, char *ssid, char *pass, IpAddr ipaddr, IpAddr netmask);
     /**
      * limited AP
      * @param sec GSSEC_OPEN or GSSEC_WEP
-     * @param ssid
+     * @param ssid SSID
      * @param pass 10 or 26 hexadecimal digits
+     * @param ipaddr my ip address (dhcp start address)
+     * @param netmask subnet mask
+     * @retval 0 success
+     * @retval -1 failure
      * firmware: s2w-secureweb, s2w-web, s2w-wpsweb
      */
     int limitedap (GSSECURITY sec, char *ssid, char *pass, IpAddr ipaddr, IpAddr netmask);
@@ -169,10 +178,18 @@
     int getAddress (IpAddr &ipaddr, IpAddr &netmask, IpAddr &gateway, IpAddr &nameserver);
     /**
      * resolv hostname
+     * @param name hostname
+     * @param addr resolved ip address
+     * @retval 0 success
+     * @retval -1 failure
      */
     int getHostByName (const char* name, IpAddr &addr);
     /**
      * resolv hostname
+     * @param host.name hostname
+     * @param host.ipaddr resolved ip address
+     * @retval 0 success
+     * @retval -1 failure
      */
     int getHostByName (Host &host);
     /**
@@ -182,8 +199,10 @@
     int setRFPower (int power);
     /**
      * power save mode
+     * @param active 0:switched off, 1:always on
+     * @param save 0:disable, 1:enable
      */
-    int powerSave (int beacon = 10, int association = 1);
+    int powerSave (int active, int save);
     /**
      * standby mode
      * @param msec wakeup after
@@ -205,15 +224,17 @@
     bool isConnected ();
     /**
      * status
+     * @return GSSTATUS
      */
     GSSTATUS getStatus ();
     /**
-     * RSSI dBm
+     * RSSI
+     * @return dBm
      */
     int getRssi ();
 
     /**
-     * polling
+     * main polling
      */
     void poll();
 
@@ -268,7 +289,7 @@
     int x2i (char c);
     char i2x (int i);
     void isr_recv ();
-    int newSock (int cid, GSTYPE type, GSPROTOCOL pro, onGsReceiveFunc ponGsReceive);
+    void newSock (int cid, GSTYPE type, GSPROTOCOL pro, onGsReceiveFunc ponGsReceive);
 
 private:
     Serial _gs;