A http client sample program.

Dependencies:   NyFileSystems libMiMic mbed-rtos mbed

Fork of TcpSocketClientSamlpe by Ryo Iizuka

Files at this revision

API Documentation at this revision

Comitter:
nyatla
Date:
Sun May 05 03:32:31 2013 +0000
Parent:
9:e3de48c39ffd
Child:
11:9f5f3ee2dc63
Commit message:
update libMiMic; Add platform auto detection.; The completely same binary runs on mbed and LPCXpresso1769.;

Changed in this revision

libMiMic.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/libMiMic.lib	Mon Apr 29 08:26:22 2013 +0000
+++ b/libMiMic.lib	Sun May 05 03:32:31 2013 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/nyatla/code/libMiMic/#1a13899a5a1c
+http://mbed.org/users/nyatla/code/libMiMic/#87fecac39b9f
--- a/main.cpp	Mon Apr 29 08:26:22 2013 +0000
+++ b/main.cpp	Sun May 05 03:32:31 2013 +0000
@@ -11,14 +11,15 @@
 #include "mbed.h"
 #include "SDFileSystem.h"
 #include "mimic.h"
-
+#include "utils/PlatformInfo.h"
+DigitalOut mbedled(LED1);
+DigitalOut lpcxled(P0_22);
 
 /**
  * local filesystem support.
  */
-LocalFileSystem lf("local");
+LocalFileSystem2 lf("local");
 SDFileSystem sd(p5, p6, p7, p8,"sd");
-DigitalOut led1(LED1);
 unsigned int p;
 /**
  * MiMic RemoteMCU httpd.<br/>
@@ -43,7 +44,14 @@
     virtual void onRequest(HttpdConnection& i_connection)
     {
         p++;
-        led1=p%2;
+        switch(PlatformInfo::getPlatformType()){
+        case PlatformInfo::PF_MBED:
+            mbedled = p%2;
+            break;
+        case PlatformInfo::PF_LPCXPRESSO:        
+            lpcxled = p%2;
+            break;
+        }
         //try to ModLocalFileSystem
         if(this->modlocal.execute(i_connection)){
             return;
@@ -76,6 +84,7 @@
     Net net(cfg);  //create a net instance.
     //try to override setting by local file.
     if(!cfg.loadFromFile("/local/mimic.cfg")){
+        wait_ms(1000);
         cfg.loadFromFile("/sd/mimic.cfg");
     }    
     FsHttpd httpd; //create a httpd instance.