template of http server test program
Dependencies: C12832_lcd EthernetNetIf HTTPServer mbed
Fork of http_server_template by
Revision 1:55ec054200fd, committed 2013-09-28
- Comitter:
- khayakawa
- Date:
- Sat Sep 28 16:27:36 2013 +0000
- Parent:
- 0:148f9f924f8e
- Commit message:
- KEIS
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 148f9f924f8e -r 55ec054200fd main.cpp --- a/main.cpp Thu Jul 18 14:30:46 2013 +0000 +++ b/main.cpp Sat Sep 28 16:27:36 2013 +0000 @@ -31,5 +31,30 @@ int main(void) { + + // lcd.locate(0,3); + lcd.printf("Program init.. "); + + if (ethif.setup()) { + error("Ethernet setup failed."); + return 1; + } + IpAddr ethIp=ethif.getIp(); + + + wait(1.0); + server.addHandler<SimpleHandler>("/hello"); + FSHandler::mount("/local", "/"); + server.addHandler<FSHandler>("/"); + server.bind(80); + + lcd.cls(); + lcd.locate(0,15); + lcd.printf("%d.%d.%d.%d", ethIp[0], ethIp[1], ethIp[2], ethIp[3]); + + while (1) { + Net::poll(); + } + return 0; }