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)
GSwifiInterface.cpp@7:f94c59d0c735, 2013-03-11 (annotated)
- Committer:
- gsfan
- Date:
- Mon Mar 11 08:21:14 2013 +0000
- Revision:
- 7:f94c59d0c735
- Parent:
- 5:78943b3945b5
fix getmacaddress
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
gsfan | 5:78943b3945b5 | 1 | /* Copyright (C) 2013 gsfan, MIT License |
gsfan | 5:78943b3945b5 | 2 | * port to the GainSpan Wi-FI module GS1011 |
gsfan | 5:78943b3945b5 | 3 | */ |
gsfan | 5:78943b3945b5 | 4 | |
gsfan | 5:78943b3945b5 | 5 | #include "GSwifiInterface.h" |
gsfan | 5:78943b3945b5 | 6 | |
gsfan | 5:78943b3945b5 | 7 | GSwifiInterface::GSwifiInterface( PinName tx, PinName rx, PinName cts, PinName rts, PinName reset, |
gsfan | 5:78943b3945b5 | 8 | const char * ssid, const char * phrase, Security sec) : |
gsfan | 5:78943b3945b5 | 9 | GSwifi(tx, rx, cts, rts, reset, ssid, phrase, sec) |
gsfan | 5:78943b3945b5 | 10 | { |
gsfan | 5:78943b3945b5 | 11 | } |
gsfan | 5:78943b3945b5 | 12 | |
gsfan | 5:78943b3945b5 | 13 | int GSwifiInterface::init() |
gsfan | 5:78943b3945b5 | 14 | { |
gsfan | 5:78943b3945b5 | 15 | _state.dhcp = true; |
gsfan | 5:78943b3945b5 | 16 | return 0; |
gsfan | 5:78943b3945b5 | 17 | } |
gsfan | 5:78943b3945b5 | 18 | |
gsfan | 5:78943b3945b5 | 19 | int GSwifiInterface::init(const char* ip, const char* mask, const char* gateway) |
gsfan | 5:78943b3945b5 | 20 | { |
gsfan | 5:78943b3945b5 | 21 | _state.dhcp = false; |
gsfan | 5:78943b3945b5 | 22 | strncpy(_ip, ip, sizeof(_ip)); |
gsfan | 5:78943b3945b5 | 23 | strncpy(_netmask, mask, sizeof(_netmask)); |
gsfan | 5:78943b3945b5 | 24 | strncpy(_gateway, gateway, sizeof(_gateway)); |
gsfan | 5:78943b3945b5 | 25 | |
gsfan | 5:78943b3945b5 | 26 | return 0; |
gsfan | 5:78943b3945b5 | 27 | } |
gsfan | 5:78943b3945b5 | 28 | |
gsfan | 5:78943b3945b5 | 29 | int GSwifiInterface::connect() |
gsfan | 5:78943b3945b5 | 30 | { |
gsfan | 5:78943b3945b5 | 31 | return join(); |
gsfan | 5:78943b3945b5 | 32 | } |
gsfan | 5:78943b3945b5 | 33 | |
gsfan | 5:78943b3945b5 | 34 | int GSwifiInterface::disconnect() |
gsfan | 5:78943b3945b5 | 35 | { |
gsfan | 5:78943b3945b5 | 36 | return GSwifi::disconnect(); |
gsfan | 5:78943b3945b5 | 37 | } |
gsfan | 5:78943b3945b5 | 38 | |
gsfan | 5:78943b3945b5 | 39 | char * GSwifiInterface::getIPAddress() |
gsfan | 5:78943b3945b5 | 40 | { |
gsfan | 5:78943b3945b5 | 41 | |
gsfan | 5:78943b3945b5 | 42 | return _ip; |
gsfan | 7:f94c59d0c735 | 43 | } |
gsfan | 7:f94c59d0c735 | 44 | |
gsfan | 7:f94c59d0c735 | 45 | char * GSwifiInterface::getMACAddress() |
gsfan | 7:f94c59d0c735 | 46 | { |
gsfan | 7:f94c59d0c735 | 47 | |
gsfan | 7:f94c59d0c735 | 48 | return _mac; |
gsfan | 7:f94c59d0c735 | 49 | } |