Chris Styles
/
HelloServerDemo
Revision 0:a87ea5d8da61, committed 2009-09-21
- Comitter:
- chris
- Date:
- Mon Sep 21 12:08:04 2009 +0000
- Commit message:
Changed in this revision
diff -r 000000000000 -r a87ea5d8da61 HTTPServer.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/HTTPServer.lib Mon Sep 21 12:08:04 2009 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_unsupported/code/lwip/ \ No newline at end of file
diff -r 000000000000 -r a87ea5d8da61 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Sep 21 12:08:04 2009 +0000 @@ -0,0 +1,19 @@ +#include "mbed.h" +#include "HTTPServer.h" +#include "HTTPStaticPage.h" + +#include <string.h> + +const char content[] = "<HTML><BODY><H1>Hello World</H1></BODY></HTML>"; + +HTTPServer http; + +int main(void) { + http.addHandler(new HTTPStaticPage("/index.htm", content, strlen(content))); + http.bind(); + NetServer *net = NetServer::get(); + printf("%hhu.%hhu.%hhu.%hhu\n", (net->getIPAddr().addr)&0xFF, (net->getIPAddr().addr>>8)&0xFF, (net->getIPAddr().addr>>16)&0xFF, (net->getIPAddr().addr>>24)&0xFF); + while(1) { + http.poll(); + } +} \ No newline at end of file
diff -r 000000000000 -r a87ea5d8da61 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Sep 21 12:08:04 2009 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/f63353af7be8