copy of TCPEchoServer, with changes for a make-shift garage door opener
Dependencies: EthernetInterface mbed-rtos mbed
Fork of TCPEchoServer by
Diff: main.cpp
- Revision:
- 7:e2ffd7edf9c9
- Parent:
- 6:ef919d4efe56
- Child:
- 8:9c587d7ed39e
diff -r ef919d4efe56 -r e2ffd7edf9c9 main.cpp --- a/main.cpp Mon Jan 21 07:40:08 2013 +0000 +++ b/main.cpp Mon Jan 21 07:47:59 2013 +0000 @@ -32,8 +32,7 @@ char buffer[256]; // HTTP is statusline + headers + \r\n + body - - //body of different pages + // these are in that format char firstpage[] = {"HTTP/1.1 200 OK\r\nContent-Type: text/html; charset=UTF-8\r\nContent-Length: 213\r\n\r\n<html><head><title>Garage Door</title></head><body><h4>Garage Door Opener</h4><form action=index.html method=post><input style='border : 1px solid #000000;' value='Open/Close' type='submit' /></form></body></html>"}; char secondpage[] = {"HTTP/1.1 200 OK\r\nContent-Type: text/html; charset=UTF-8\r\nContent-Length: 248\r\n\r\n<html><head><title>Pressing Button</title></head><body><h4>Garage Door Opener</h4><p>Door should be moving...</p><form action=index.html method=post><input style='border : 1px solid #000000;' value='Open/Close' type='submit' /></form></body></html>"}; char error[] = {"HTTP/1.1 501 Not Implemented\r\nContent-Type: text/html; charset=UTF-8\r\nContent-Length: 100\r\n\r\n<html><head><title>Error</title></head><body>Sorry, I don't understand your request :(</body></html>"};