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:
1:b127c6c5241d
Parent:
0:2f6062c6d018
Child:
2:c6e0e97901b3
diff -r 2f6062c6d018 -r b127c6c5241d GSwifi.h
--- a/GSwifi.h	Mon Jul 09 14:36:06 2012 +0000
+++ b/GSwifi.h	Thu Jul 12 08:19:50 2012 +0000
@@ -16,6 +16,7 @@
 #include "ipaddr.h"
 
 #define GS_BAUD 115200
+#define GS_UART_DIRECT
 
 #define GS_BULK
 
@@ -69,6 +70,7 @@
     GSRES_DHCP,
     GSRES_DNSLOOKUP,
     GSRES_HTTP,
+    GSRES_RSSI,
 };
 
 enum GSMODE {
@@ -90,7 +92,7 @@
 /**
  * data receive callback function
  */
-typedef void (*onGsReceiveFunc)(int cid, int acid, int len);
+typedef void (*onGsReceiveFunc)(int cid, int len);
 
 struct GS_Socket {
     GSTYPE type;
@@ -98,7 +100,7 @@
     bool connect;
     Host host;
     RingBuffer *data;
-    int acid;
+    int lcid;
     int received;
     onGsReceiveFunc onGsReceive;
 };
@@ -162,6 +164,10 @@
      */
     int setAddress (IpAddr ipaddr, IpAddr netmask, IpAddr gateway, IpAddr nameserver);
     /**
+     * get ip address
+     */
+    int getAddress (IpAddr &ipaddr, IpAddr &netmask, IpAddr &gateway, IpAddr &nameserver);
+    /**
      * resolv hostname
      */
     int getHostByName (const char* name, IpAddr &addr);
@@ -201,6 +207,10 @@
      * status
      */
     GSSTATUS getStatus ();
+    /**
+     * RSSI dBm
+     */
+    int getRssi ();
 
     /**
      * polling
@@ -258,6 +268,7 @@
     int x2i (char c);
     char i2x (int i);
     void isr_recv ();
+    int newSock (int cid, GSTYPE type, GSPROTOCOL pro, onGsReceiveFunc ponGsReceive);
 
 private:
     Serial _gs;
@@ -267,7 +278,7 @@
     volatile int _gs_ok, _gs_failure, _gs_enter;
     GSMODE _gs_mode;
     int _escape;
-    int _cid;
+    int _cid, _rssi;
     IpAddr _ipaddr, _netmask, _gateway, _nameserver, _resolv;
     Host _from, _to;
     char mac[6];