Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed NyFileSystems mbed-rtos libMiMic
Diff: main.cpp
- Revision:
- 12:218b57d9a6d4
- Parent:
- 10:80c05810f911
- Child:
- 19:66d729b94d16
--- a/main.cpp Tue May 14 13:11:55 2013 +0000
+++ b/main.cpp Thu Jun 20 02:11:11 2013 +0000
@@ -35,7 +35,7 @@
ModLocalFileSystem modlocal;
ModLocalFileSystem modsd;
public:
- FsHttpd():Httpd(80)
+ FsHttpd(NetConfig& i_cfg):Httpd(i_cfg._inst.services.http_port)
{
//bind local file system path to /local/*
modlocal.setParam("local");
@@ -78,16 +78,19 @@
}
};
+NetConfig cfg; //create network configulation
+
int main()
{
- NetConfig cfg; //create network configulation
- Net net(cfg); //create a net instance.
+ Net net; //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.
+ }
+ FsHttpd httpd(cfg); //create a httpd instance.
+ net.start(cfg);
httpd.loop(); //start httpd loop.
return 0;
}