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:
22:9b077e2823ce
Parent:
20:151b5a4fdd29
Child:
23:a783c62c36d0
diff -r 1270827d431a -r 9b077e2823ce GSwifi_httpd.cpp
--- a/GSwifi_httpd.cpp	Thu Nov 08 01:35:37 2012 +0000
+++ b/GSwifi_httpd.cpp	Wed Dec 26 08:41:43 2012 +0000
@@ -10,15 +10,16 @@
 #define HTTPD_BODY 3
 #define HTTPD_ERROR 4
 
-#define MIMETABLE_NUM 7
+#define MIMETABLE_NUM 8
 struct {
     char ext[6];
-    char type[20];
+    char type[24];
 } mimetable[MIMETABLE_NUM] = {
     {".txt", "text/plain"},
     {".html", "text/html"},
     {".htm", "text/html"},
     {".css", "text/css"},
+    {".js", "application/javascript"},
     {".jpg", "image/jpeg"},
     {".png", "image/png"},
     {".gif", "image/gif"},
@@ -122,7 +123,8 @@
         if (strncmp(_httpd[cid].buf, "Content-Length: ", 16) == 0) {
             _httpd[cid].length = atoi(&_httpd[cid].buf[16]);
         } else
-        if (strncmp(_httpd[cid].buf, "Connection: Keep-Alive", 22) == 0) {
+        if (strncmp(_httpd[cid].buf, "Connection: Keep-Alive", 22) == 0 ||
+          strncmp(_httpd[cid].buf, "Connection: keep-alive", 22) == 0) {
             if (! _httpd[cid].keepalive) {
                 _httpd[cid].keepalive = HTTPD_KEEPALIVE;
             }
@@ -237,6 +239,7 @@
         for (;;) {
             i = fread(buf, sizeof(char), sizeof(buf), fp);
             if (i <= 0) break;
+            if (! _gs_sock[cid].connect) break;
             send(cid, buf, i);
 #if defined(TARGET_LPC1768) || defined(TARGET_LPC2368)
             if (feof(fp)) break;