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)
Revision 7:f94c59d0c735, committed 2013-03-11
- Comitter:
- gsfan
- Date:
- Mon Mar 11 08:21:14 2013 +0000
- Parent:
- 6:6a6396b56405
- Commit message:
- fix getmacaddress
Changed in this revision
--- a/GSwifi/GSwifi.cpp Wed Jan 30 05:52:14 2013 +0000 +++ b/GSwifi/GSwifi.cpp Mon Mar 11 08:21:14 2013 +0000 @@ -91,7 +91,6 @@ send("\r\n", 2); if (sendCommand("ATE0") == false) return -1; if (_rts) { - sendCommand("AT&K0"); sendCommand("AT&R1"); } @@ -544,16 +543,7 @@ break; case RES_MACADDRESS: if (buf[2] == ':' && buf[5] == ':') { -/* - int mac1, mac2, mac3, mac4, mac5, mac6; - sscanf(buf, "%x:%x:%x:%x:%x:%x", &mac1, &mac2, &mac3, &mac4, &mac5, &mac6); - _mac[0] = mac1; - _mac[1] = mac2; - _mac[2] = mac3; - _mac[3] = mac4; - _mac[4] = mac5; - _mac[5] = mac6; -*/ + strncpy(_mac, buf, sizeof(_mac)); _state.cmdres = RES_OK; } break;
--- a/GSwifi/GSwifi.h Wed Jan 30 05:52:14 2013 +0000 +++ b/GSwifi/GSwifi.h Mon Mar 11 08:21:14 2013 +0000 @@ -237,6 +237,7 @@ DigitalOut _reset; char _phrase[30]; char _ssid[30]; + char _mac[18]; char _ip[16]; char _netmask[16]; char _gateway[16];
--- a/GSwifiInterface.cpp Wed Jan 30 05:52:14 2013 +0000 +++ b/GSwifiInterface.cpp Mon Mar 11 08:21:14 2013 +0000 @@ -40,4 +40,10 @@ { return _ip; -} \ No newline at end of file +} + +char * GSwifiInterface::getMACAddress() +{ + + return _mac; +}
--- a/GSwifiInterface.h Wed Jan 30 05:52:14 2013 +0000 +++ b/GSwifiInterface.h Mon Mar 11 08:21:14 2013 +0000 @@ -77,7 +77,12 @@ * @ returns ip address */ char* getIPAddress(); - + /** Get MAC address + * + * @ returns mac address + */ + char* getMACAddress(); + private: char _ip_string[20]; bool _ip_set;