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

Dependents:   GSwifi_httpd GSwifi_websocket GSwifi_tcpclient GSwifi_tcpserver ... more

Fork of GSwifi 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/

/media/uploads/gsfan/gs_im_002.jpg /media/uploads/gsfan/gs1011m_2.jpg

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

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

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

Revision:
19:cad912f5a6ba
Parent:
18:4b97804c37d1
Child:
20:151b5a4fdd29
--- a/GSwifi.h	Thu Nov 01 02:55:57 2012 +0000
+++ b/GSwifi.h	Tue Nov 06 08:54:19 2012 +0000
@@ -142,7 +142,7 @@
      * @retval 0 success
      * @retval -1 failure
      */
-    int connect (GSSECURITY sec, char *ssid, char *pass, int dhcp = 1);
+    int connect (GSSECURITY sec, const char *ssid, const char *pass, int dhcp = 1);
     /**
      * adhock
      * @param sec GSSEC_OPEN or GSSEC_WEP
@@ -153,7 +153,7 @@
      * @retval 0 success
      * @retval -1 failure
      */
-    int adhock (GSSECURITY sec, char *ssid, char *pass, IpAddr ipaddr, IpAddr netmask);
+    int adhock (GSSECURITY sec, const char *ssid, const char *pass, IpAddr ipaddr, IpAddr netmask);
     /**
      * limited AP
      * @param sec GSSEC_OPEN or GSSEC_WEP
@@ -165,7 +165,7 @@
      * @retval -1 failure
      * firmware: s2w-secureweb, s2w-web, s2w-wpsweb
      */
-    int limitedap (GSSECURITY sec, char *ssid, char *pass, IpAddr ipaddr, IpAddr netmask);
+    int limitedap (GSSECURITY sec, const char *ssid, const char *pass, IpAddr ipaddr, IpAddr netmask);
     /**
      * unassociate
      */
@@ -288,11 +288,11 @@
     /**
      * send data tcp(s/c), udp(c)
      */
-    int send (int cid, char *buf, int len);
+    int send (int cid, const char *buf, int len);
     /**
      * send data udp(s)
      */
-    int send (int cid, char *buf, int len, Host &host);
+    int send (int cid, const char *buf, int len, Host &host);
     /**
      * recv data tcp(s/c), udp(c)
      * @return length
@@ -311,18 +311,18 @@
     /**
      * http request (GET method)
      */
-    int httpGet (Host &host, char *uri, char *user, char *pwd, int ssl = 0, onGsReceiveFunc ponGsReceive = NULL);
-    int httpGet (Host &host, char *uri, int ssl = 0, onGsReceiveFunc ponGsReceive = NULL);
+    int httpGet (Host &host, const char *uri, const char *user, const char *pwd, int ssl = 0, onGsReceiveFunc ponGsReceive = NULL);
+    int httpGet (Host &host, const char *uri, int ssl = 0, onGsReceiveFunc ponGsReceive = NULL);
     /**
      * http request (POST method)
      */
-    int httpPost (Host &host, char *uri, char *body, char *user, char *pwd, int ssl = 0, onGsReceiveFunc ponGsReceive = NULL);
-    int httpPost (Host &host, char *uri, char *body, int ssl = 0, onGsReceiveFunc ponGsReceive = NULL);
+    int httpPost (Host &host, const char *uri, const char *body, const char *user, const char *pwd, int ssl = 0, onGsReceiveFunc ponGsReceive = NULL);
+    int httpPost (Host &host, const char *uri, const char *body, int ssl = 0, onGsReceiveFunc ponGsReceive = NULL);
 
     /**
      * certificate 
      */
-    int certAdd (char *name, char *cert, int len);
+    int certAdd (const char *name, const char *cert, int len);
 
     /**
      * send mail (smtp)
@@ -336,7 +336,7 @@
      * @retval 0 success
      * @retval -1 failure
      */
-    int mail (Host &host, char *to, char *from, char *subject, char *mesg, char *user = NULL, char *pwd = NULL);
+    int mail (Host &host, const char *to, const char *from, const char *subject, const char *mesg, const char *user = NULL, const char *pwd = NULL);
 
     /**
      * start http server
@@ -350,16 +350,16 @@
     /**
      * attach uri to dirctory handler
      */
-    int attach_httpd (char *uri, char *dir);
+    int attach_httpd (const char *uri, const char *dir);
     /**
      * attach uri to cgi handler
      */
-    int attach_httpd (char *uri, onHttpdCgiFunc ponHttpCgi);
+    int attach_httpd (const char *uri, onHttpdCgiFunc ponHttpCgi);
 
     /**
      * base64 encode
      */
-    int base64encode (const char *input, int length, char *output, int len);
+    int base64encode (char *input, int length, char *output, int len);
     /**
      * url encode
      */
@@ -383,10 +383,11 @@
     int wait_smtp (int cid, int code);
 
     // http server
-    void poll_httpd (int cid, int len);
-    int httpd_request (int cid, char *dir, char *file, int keep);
+    int httpd_request (int cid, GS_httpd *gshttpd, char *dir);
+    char *mimetype (char *file);
 
 private:
+    void poll_httpd (int cid, int len);
     Serial _gs;
     bool _rts;
     volatile bool _connect;