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 mbed official

GainSpan Wi-Fi library

The GS1011/GS2100 is an ultra low power 802.11b wireless module from GainSpan.

mbed RTOS supported.

/media/uploads/gsfan/gs_im_002.jpg /media/uploads/gsfan/gs1011m_2.jpg

ゲインスパン Wi-Fi モジュール ライブラリ

ゲインスパン社の低電力 Wi-Fiモジュール(無線LAN) GS1011/GS2100 シリーズ用のライブラリです。

mbed RTOS に対応しています。(mbed2.0)

Revision:
11:71d67fea5ace
Parent:
8:64184a968e3b
Child:
12:057089026a20
--- a/GSwifiInterface.cpp	Thu Oct 31 08:34:45 2013 +0000
+++ b/GSwifiInterface.cpp	Fri Nov 15 04:20:14 2013 +0000
@@ -11,32 +11,24 @@
 
 int GSwifiInterface::init(const char* name)
 {
-    _state.dhcp = true;
-    strncpy(_state.name, name, sizeof(_state.name));
-
-    return 0;
+    return setAddress(name);
 }
 
-int GSwifiInterface::init(const char* ip, const char* mask, const char* gateway, const char* name)
+int GSwifiInterface::init(const char* ip, const char* netmask, const char* gateway, const char* name)
 {
-    _state.dhcp = false;
-    strncpy(_state.ip, ip, sizeof(_state.ip));
-    strncpy(_state.netmask, mask, sizeof(_state.netmask));
-    strncpy(_state.gateway, gateway, sizeof(_state.gateway));
-    strncpy(_state.name, name, sizeof(_state.name));
-
-    return 0;
+    return setAddress(ip, netmask, gateway, name);
 }
 
 int GSwifiInterface::connect(Security sec, const char* ssid, const char* phrase, WiFiMode mode)
 {
+    setSsid(sec, ssid, phrase);
     switch (mode) {
     case WM_INFRASTRUCTURE:
-        return join(sec, ssid, phrase);
+        return join();
     case WM_ADHOCK:
-        return adhock(sec, ssid, phrase);
+        return adhock();
     case WM_LIMITEDAP:
-        return limitedap(sec, ssid, phrase);
+        return limitedap();
     }
     return -1;
 }