see: http://mbed.org/users/gsfan/notebook/GSwifiInterface/

Dependencies:   GSwifiInterface mbed-rtos mbed

Files at this revision

API Documentation at this revision

Comitter:
gsfan
Date:
Thu Oct 31 08:41:25 2013 +0000
Commit message:
1st build;

Changed in this revision

GSwifiInterface.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-rtos.lib Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 7b52cc18f66f GSwifiInterface.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/GSwifiInterface.lib	Thu Oct 31 08:41:25 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/gsfan/code/GSwifiInterface/#7d8134e7df01
diff -r 000000000000 -r 7b52cc18f66f main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Oct 31 08:41:25 2013 +0000
@@ -0,0 +1,29 @@
+#include "mbed.h"
+#include "GSwifiInterface.h"
+
+#define SEC  GSwifi::SEC_WPA_PSK
+#define SSID "SSID"
+#define PASS "PASSPHRASE"
+
+#define ECHO_SERVER_PORT   10000
+
+int main() {
+    GSwifiInterface gs(p13, p14, p12, P0_22, p20, NC);
+    printf("UDP Echo Server...\n");
+    gs.init(); //Use DHCP
+    if (gs.connect(SEC, SSID, PASS)) return -1; // join the network
+    printf("IP Address is %s\n", gs.getIPAddress());
+    
+    UDPSocket server;
+    server.bind(ECHO_SERVER_PORT);
+    
+    Endpoint client;
+    char buffer[256];
+    while (true) {
+        printf("\nWait for packet...\n");
+        int n = server.receiveFrom(client, buffer, sizeof(buffer));
+        
+        printf("Received packet from: %s\n", client.get_address());
+        server.sendTo(client, buffer, n);
+    }
+}
diff -r 000000000000 -r 7b52cc18f66f mbed-rtos.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-rtos.lib	Thu Oct 31 08:41:25 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed-rtos/#ee87e782d34f
diff -r 000000000000 -r 7b52cc18f66f mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Oct 31 08:41:25 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/f37f3b9c9f0b
\ No newline at end of file