GSwifiInterface (interface for GainSpan Wi-Fi GS1011 modules) see https://mbed.org/users/gsfan/notebook/GSwifiInterface/
Dependencies: GSwifiInterface mbed
Fork of Wifly_HelloWorld by
Diff: main.cpp
- Revision:
- 6:2e3441cd9128
- Parent:
- 5:867d16e948eb
- Child:
- 7:3644ae697c52
--- a/main.cpp Fri Aug 24 13:52:40 2012 +0000 +++ b/main.cpp Sun Jan 27 14:37:15 2013 +0000 @@ -1,21 +1,23 @@ #include "mbed.h" -#include "WiflyInterface.h" +#include "GSwifiInterface.h" Serial pc(USBTX, USBRX); -/* wifly object where: -* - p9 and p10 are for the serial communication -* - p25 is for the reset pin -* - p26 is for the connection status -* - "mbed" is the ssid of the network -* - "password" is the password -* - WPA is the security +/* GSwifi object where: +* - p13 and p14 are for the serial communication +* - p12 and P0_22 are for the serial handshake (optional) +* - p9 is for the reset pin +* - "SSID" is the ssid of the network +* - "PHRASE" is the password +* - SEC_WEP is the security */ -WiflyInterface wifly(p9, p10, p25, p26, "mbed", "password", WPA); +//GSwifiInterface gs(p13, p14, p12, P0_22, p9, "SSID", "PHRASE", GSwifi::SEC_WPA_PSK); +GSwifiInterface gs(p13, p14, NC, NC, p9, "SSID", "PHRASE", GSwifi::SEC_WEP); +// TX, RX, CTS, RTS, RESET int main() { - wifly.init(); // use DHCP - while (!wifly.connect()); // join the network - printf("IP Address is %s\n\r", wifly.getIPAddress()); - wifly.disconnect(); -} \ No newline at end of file + gs.init(); // use DHCP + if (gs.connect()) return -1; // join the network + printf("IP Address is %s\n\r", gs.getIPAddress()); + gs.disconnect(); +}