![](/media/cache/profiles/3850b1a23fec9e1b958601a27109d0d5.50x50_q85.jpg)
Revision 0:3c4b5881fb9a, committed 2011-08-24
- Comitter:
- bouguereau
- Date:
- Wed Aug 24 09:46:30 2011 +0000
- Commit message:
Changed in this revision
diff -r 000000000000 -r 3c4b5881fb9a EthernetNetIf.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/EthernetNetIf.lib Wed Aug 24 09:46:30 2011 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mamezu/code/EthernetNetIf/#0f6c82fcde82
diff -r 000000000000 -r 3c4b5881fb9a main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Aug 24 09:46:30 2011 +0000 @@ -0,0 +1,39 @@ +#include "mbed.h" +#include "EthernetNetIf.h" +#include "HTTPServer.h" + +EthernetNetIf eth; +HTTPServer svr; + +DigitalOut led1(LED1); + +int main() { + printf("Setting up...\n"); + EthernetErr ethErr = eth.setup(); + if(ethErr) + { + printf("Error %d in setup.\n", ethErr); + return -1; + } + printf("Setup OK\n"); + + svr.addHandler<SimpleHandler>("/"); //Default handler + svr.bind(80); + + printf("Listening...\n"); + + Timer tm; + tm.start(); + //Listen indefinitely + while(true) + { + Net::poll(); + if(tm.read()>.5) + { + led1=!led1; //Show that we are alive + tm.start(); + } + } + + return 0; +}
diff -r 000000000000 -r 3c4b5881fb9a mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed Aug 24 09:46:30 2011 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/63bcd7ba4912