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
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/
ゲインスパン Wi-Fi モジュール ライブラリ
ゲインスパン社の低電力 Wi-Fiモジュール(無線LAN) GS1011 シリーズ用のライブラリです。
解説: http://mbed.org/users/gsfan/notebook/gainspan_wifi/
Diff: GSwifi.h
- Revision:
- 29:1c4419512941
- Parent:
- 28:fbba4c58d14c
- Child:
- 31:0abdc584823d
--- a/GSwifi.h Fri Feb 22 03:07:43 2013 +0000 +++ b/GSwifi.h Tue Feb 26 02:48:31 2013 +0000 @@ -264,7 +264,7 @@ /** * get mac address */ - int getMac (char *mac); + int getMacAddress (char *mac); /** * resolv hostname * @param name hostname @@ -427,12 +427,27 @@ * http request (GET method) */ 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); + int httpGet (Host &host, const char *uri, int ssl = 0, onGsReceiveFunc ponGsReceive = NULL) { + return httpGet (host, uri, NULL, NULL, ssl, ponGsReceive); + } /** * http request (POST method) */ 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); + int httpPost (Host &host, const char *uri, const char *body, int ssl = 0, onGsReceiveFunc ponGsReceive = NULL) { + return httpPost (host, uri, body, NULL, NULL, ssl, ponGsReceive); + } + /** + * websocket request (Upgrade method) + */ + int wsOpen (Host &host, const char *uri, const char *user, const char *pwd, onGsReceiveFunc ponGsReceive = NULL); + int wsOpen (Host &host, const char *uri, onGsReceiveFunc ponGsReceive = NULL) { + return wsOpen (host, uri, NULL, NULL, ponGsReceive); + } + /** + * send data websocket + */ + int wsSend (int cid, const char *buf, int len, const char *mask = NULL); /** * base64 encode @@ -483,9 +498,6 @@ * attach uri to cgi handler */ int attach_httpd (const char *uri, onHttpdCgiFunc ponHttpCgi); -#ifdef GS_USE_WEBSOCKET - int send_websocket (int cid, const char *buf, int len); -#endif #endif #ifdef DEBUG @@ -518,6 +530,8 @@ _gs_sock[cid].onGsReceive.attach(object, member); } + int wait_ws (int cid, int code); + #ifdef GS_USE_SMTP int wait_smtp (int cid, int code); #endif