GSwifiInterface library (interface for GainSpan Wi-Fi GS1011 modules) Please see https://mbed.org/users/gsfan/notebook/GSwifiInterface/
Dependents: GSwifiInterface_HelloWorld GSwifiInterface_HelloServo GSwifiInterface_UDPEchoServer GSwifiInterface_UDPEchoClient ... more
Fork of WiflyInterface by
GainSpan Wi-Fi library
The GS1011/GS2100 is an ultra low power 802.11b wireless module from GainSpan.
mbed RTOS supported.
- about this library: http://mbed.org/users/gsfan/notebook/GSwifiInterface/
- about Wi-Fi module: http://mbed.org/users/gsfan/notebook/gainspan_wifi/
ゲインスパン Wi-Fi モジュール ライブラリ
ゲインスパン社の低電力 Wi-Fiモジュール(無線LAN) GS1011/GS2100 シリーズ用のライブラリです。
mbed RTOS に対応しています。(mbed2.0)
- このライブラリについて: http://mbed.org/users/gsfan/notebook/gainspan_wifi/
- Wi-FIモジュールについて: http://mbed.org/users/gsfan/notebook/gainspan_wifi/
- UARTコマンド、SPIデータインターフェースに対応しました。(2019/09)
Diff: GSwifi/GSwifi_httpd_ws.cpp
- Revision:
- 17:c30ed7b1536d
- Parent:
- 15:086d1a33a197
--- a/GSwifi/GSwifi_httpd_ws.cpp Tue Mar 04 15:01:38 2014 +0000 +++ b/GSwifi/GSwifi_httpd_ws.cpp Fri Mar 07 15:16:55 2014 +0000 @@ -39,7 +39,7 @@ DBG("ws cid %d\r\n", cid); // request - snprintf(cmd, sizeof(cmd), "GET %d HTTP/1.1\r\n", uri); + snprintf(cmd, sizeof(cmd), "GET %s HTTP/1.1\r\n", uri); send(cid, cmd, strlen(cmd)); if (host) { snprintf(cmd, sizeof(cmd), "Host: %s\r\n", host); @@ -55,11 +55,13 @@ send(cid, cmd, strlen(cmd)); strcpy(cmd, "Connection: Upgrade\r\n"); send(cid, cmd, strlen(cmd)); - getMacAddress(tmp); - memcpy(&tmp[6], host, 10); - base64encode(tmp, 16, cmd, sizeof(cmd)); + getMacAddress(cmd); + memcpy(&cmd[6], host, 10); + base64encode(cmd, 16, tmp, sizeof(tmp)); snprintf(cmd, sizeof(cmd), "Sec-WebSocket-Key: %s\r\n", tmp); send(cid, cmd, strlen(cmd)); +// strcpy(cmd, "Sec-WebSocket-Protocol: chat\r\n"); +// send(cid, cmd, strlen(cmd)); strcpy(cmd, "Sec-WebSocket-Version: 13\r\n\r\n"); send(cid, cmd, strlen(cmd));