Working sample which demonstrates the Http Server implementation using WiFlyHTTPServer library.

Dependencies:   WiFlyHTTPServer WiflyInterface mbed-rpc mbed

Files at this revision

API Documentation at this revision

Comitter:
leihen
Date:
Sun Jun 02 00:53:38 2013 +0000
Parent:
1:da491ef49a3e
Commit message:
Updates for changes in libraries

Changed in this revision

WiFlyHTTPServer.lib Show annotated file Show diff for this revision Revisions of this file
WiflyInterface.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
--- a/WiFlyHTTPServer.lib	Sat Jun 01 18:08:03 2013 +0000
+++ b/WiFlyHTTPServer.lib	Sun Jun 02 00:53:38 2013 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/leihen/code/WiFlyHTTPServer/#ccbdf6e28655
+http://mbed.org/users/leihen/code/WiFlyHTTPServer/#cbde7929db7f
--- a/WiflyInterface.lib	Sat Jun 01 18:08:03 2013 +0000
+++ b/WiflyInterface.lib	Sun Jun 02 00:53:38 2013 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/leihen/code/WiflyInterface/#120296f9f865
+http://mbed.org/users/leihen/code/WiflyInterface/#ac134ae11893
--- a/main.cpp	Sat Jun 01 18:08:03 2013 +0000
+++ b/main.cpp	Sun Jun 02 00:53:38 2013 +0000
@@ -1,5 +1,4 @@
 #include "mbed.h"
-#include "WiflyInterface.h"
 #include "HTTPServer.h"
 #include "FsHandler.h"
 #include "RpcHandler.h"
@@ -8,11 +7,9 @@
 
 DigitalOut myled(LED1);
 
-WiflyInterface wifly(p9, p10, p25, p26, "<Your AP Name>", "<Your Passphrase>", WPA);
-
 LocalFileSystem local("local");
 
-HTTPServer  svr;
+HTTPServer  svr(p9, p10, p30, p29, "<Your AP Name>", "<Your Passphrase>", WPA);
 
 
 RpcDigitalOut Led1(LED1, "Led1");
@@ -25,10 +22,6 @@
     
     /* Mount the local file system. */
     HTTPFsRequestHandler::mount("/local/", "/");    
-    
-    /* Start the wifly interface and connect to an AP */
-    wifly.init();
-    while(!wifly.connect());
 
     /* Add handler for file system access */    
     svr.addHandler<HTTPFsRequestHandler>("/");
@@ -41,8 +34,8 @@
     
     while(1) {
         /* get the time and the uptime from WiFly */
-        tim = wifly.getTime(false);
-        printf("Current time is : %s\n", tim);
+        tim = svr.getTime();
+        printf("Current time is : %s\n", tim.c_str());
         
        if (svr.poll(false) >= 0) {
             myled = !myled;