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:
20:151b5a4fdd29
Parent:
19:cad912f5a6ba
Child:
22:9b077e2823ce
--- a/GSwifi.h	Tue Nov 06 08:54:19 2012 +0000
+++ b/GSwifi.h	Thu Nov 08 01:28:45 2012 +0000
@@ -165,7 +165,7 @@
      * @retval -1 failure
      * firmware: s2w-secureweb, s2w-web, s2w-wpsweb
      */
-    int limitedap (GSSECURITY sec, const char *ssid, const char *pass, IpAddr ipaddr, IpAddr netmask);
+    int limitedap (GSSECURITY sec, const char *ssid, const char *pass, IpAddr ipaddr, IpAddr netmask, bool prov = false);
     /**
      * unassociate
      */
@@ -324,6 +324,7 @@
      */
     int certAdd (const char *name, const char *cert, int len);
 
+#ifdef GS_USE_SMTP
     /**
      * send mail (smtp)
      * @param host SMTP server
@@ -337,7 +338,9 @@
      * @retval -1 failure
      */
     int mail (Host &host, const char *to, const char *from, const char *subject, const char *mesg, const char *user = NULL, const char *pwd = NULL);
+#endif
 
+#ifdef GS_USE_HTTPD
     /**
      * start http server
      * @param port
@@ -355,6 +358,7 @@
      * attach uri to cgi handler
      */
     int attach_httpd (const char *uri, onHttpdCgiFunc ponHttpCgi);
+#endif
 
     /**
      * base64 encode
@@ -364,6 +368,10 @@
      * url encode
      */
     int urlencode (char *str, char *buf, int len);
+    /**
+     * url decode
+     */
+    int urldecode (char *str, char *buf, int len);
 
 #ifdef DEBUF
     void test ();
@@ -378,16 +386,19 @@
     char i2x (int i);
     void isr_recv ();
     void newSock (int cid, GSTYPE type, GSPROTOCOL pro, onGsReceiveFunc ponGsReceive);
+    int from_hex (int ch);
+    int to_hex (int code);
 
-    // send mail (smtp)
+#ifdef GS_USE_SMTP
     int wait_smtp (int cid, int code);
+#endif
 
-    // http server
+#ifdef GS_USE_HTTPD
     int httpd_request (int cid, GS_httpd *gshttpd, char *dir);
     char *mimetype (char *file);
+#endif
 
 private:
-    void poll_httpd (int cid, int len);
     Serial _gs;
     bool _rts;
     volatile bool _connect;
@@ -404,9 +415,13 @@
     struct GS_Socket _gs_sock[16];
     time_t _time;
     
+#ifdef GS_USE_HTTPD
     struct GS_httpd _httpd[16];
     struct GS_httpd_handler _handler[10];
     int _handler_count;
+
+    void poll_httpd (int cid, int len);
+#endif
 };
 
 #endif