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)

Files at this revision

API Documentation at this revision

Comitter:
gsfan
Date:
Thu Jun 05 06:12:59 2014 +0000
Parent:
20:9bfb8a13010c
Child:
22:d25a5a0d2497
Commit message:
fix init (setAddress)

Changed in this revision

GSwifi/GSwifi.cpp Show annotated file Show diff for this revision Revisions of this file
GSwifiInterface.cpp Show annotated file Show diff for this revision Revisions of this file
GSwifiInterface.h Show annotated file Show diff for this revision Revisions of this file
--- a/GSwifi/GSwifi.cpp	Thu Jun 05 06:06:19 2014 +0000
+++ b/GSwifi/GSwifi.cpp	Thu Jun 05 06:12:59 2014 +0000
@@ -424,8 +424,12 @@
     strncpy(_state.ip, ip, sizeof(_state.ip));
     strncpy(_state.netmask, netmask, sizeof(_state.netmask));
     strncpy(_state.gateway, gateway, sizeof(_state.gateway));
-    strncpy(_state.nameserver, dns, sizeof(_state.nameserver));
-    strncpy(_state.name, name, sizeof(_state.name));
+    if (dns) {
+        strncpy(_state.nameserver, dns, sizeof(_state.nameserver));
+    }
+    if (name) {
+        strncpy(_state.name, name, sizeof(_state.name));
+    }
     return 0;
 }
 
--- a/GSwifiInterface.cpp	Thu Jun 05 06:06:19 2014 +0000
+++ b/GSwifiInterface.cpp	Thu Jun 05 06:12:59 2014 +0000
@@ -14,9 +14,9 @@
     return setAddress(name);
 }
 
-int GSwifiInterface::init(const char* ip, const char* netmask, const char* gateway, const char* name)
+int GSwifiInterface::init(const char* ip, const char* netmask, const char* gateway, const char* dns, const char* name)
 {
-    return setAddress(ip, netmask, gateway, name);
+    return setAddress(ip, netmask, gateway, dns, name);
 }
 
 int GSwifiInterface::connect(Security sec, const char* ssid, const char* phrase, WiFiMode mode)
@@ -57,3 +57,4 @@
 {
     return _state.netmask;
 }
+
--- a/GSwifiInterface.h	Thu Jun 05 06:06:19 2014 +0000
+++ b/GSwifiInterface.h	Thu Jun 05 06:12:59 2014 +0000
@@ -58,7 +58,7 @@
   * \param gateway the gateway to use
   * \return 0 on success, a negative number on failure
   */
-  int init(const char* ip, const char* mask, const char* gateway, const char* name = NULL);
+  int init(const char* ip, const char* mask, const char* gateway, const char* dns = NULL, const char* name = NULL);
 
   /** Connect
   * Bring the interface up, start DHCP if needed.
@@ -105,3 +105,4 @@
 #include "UDPSocket.h"
 
 #endif /* GSWIFIINTERFACE_H_ */
+