template of http server test program
Dependencies: C12832_lcd EthernetNetIf HTTPServer mbed
Fork of http_server_template by
Diff: main.cpp
- Revision:
- 1:55ec054200fd
- Parent:
- 0:148f9f924f8e
--- 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; }