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_http.cpp
- Revision:
- 12:057089026a20
- Parent:
- 11:71d67fea5ace
--- a/GSwifi/GSwifi_http.cpp Fri Nov 15 04:20:14 2013 +0000 +++ b/GSwifi/GSwifi_http.cpp Fri Nov 22 14:03:07 2013 +0000 @@ -18,11 +18,11 @@ #include "GSwifi.h" -int GSwifi::httpGet (const char *host, int port, const char *uri, bool ssl, const char *user, const char *pwd) { +int GSwifi::httpGet (const char *host, int port, const char *uri, bool ssl, const char *user, const char *pwd, void(*func)(int)) { char ip[17]; int cid; - if (!isConnected() && _state.status == STAT_READY) return -1; + if (!isAssociated() || _state.status != STAT_READY) return -1; if (getHostByName(host, ip)) return -1; if (! port) { @@ -53,17 +53,18 @@ cid = _state.cid; _con[cid].protocol = PROTO_HTTPGET; _con[cid].type = TYPE_CLIENT; + _con[cid].func = func; cmdHTTPSEND(cid, false, uri); // GET return cid; } -int GSwifi::httpPost (const char *host, int port, const char *uri, const char *body, bool ssl, const char *user, const char *pwd) { +int GSwifi::httpPost (const char *host, int port, const char *uri, const char *body, bool ssl, const char *user, const char *pwd, void(*func)(int)) { char cmd[CFG_CMD_SIZE]; char ip[17]; int cid, len; - if (!isConnected() && _state.status == STAT_READY) return -1; + if (!isAssociated() || _state.status != STAT_READY) return -1; if (getHostByName(host, ip)) return -1; if (! port) { @@ -96,6 +97,7 @@ cid = _state.cid; _con[cid].protocol = PROTO_HTTPPOST; _con[cid].type = TYPE_CLIENT; + _con[cid].func = func; cmdHTTPSEND(cid, true, uri, len); // POST sprintf(cmd, "\x1bH%X", cid); @@ -104,7 +106,6 @@ } - /* base64encode code from * Copyright (c) 2010 Donatien Garnier (donatiengar [at] gmail [dot] com) */