Udp socket sample program. This program will send back the received packet.
Dependencies: NyFileSystems libMiMic mbed-rtos mbed
Revision 12:218b57d9a6d4, committed 2013-06-20
- Comitter:
- nyatla
- Date:
- Thu Jun 20 02:11:11 2013 +0000
- Parent:
- 11:9f5f3ee2dc63
- Child:
- 13:4740a0bc6c0d
- Commit message:
- update libMiMic; support DHCP,autoIP,mDNS
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 Tue May 14 13:11:55 2013 +0000 +++ b/libMiMic.lib Thu Jun 20 02:11:11 2013 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/nyatla/code/libMiMic/#00b8dee1538f +http://mbed.org/users/nyatla/code/libMiMic/#b0604fee76b0
--- 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; }