copy of TCPEchoServer, with changes for a make-shift garage door opener

Dependencies:   EthernetInterface mbed-rtos mbed

Fork of TCPEchoServer by mbed official

Files at this revision

API Documentation at this revision

Comitter:
elevatorguy
Date:
Mon Jan 21 19:54:57 2013 +0000
Parent:
8:9c587d7ed39e
Commit message:
comment

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Mon Jan 21 19:53:21 2013 +0000
+++ b/main.cpp	Mon Jan 21 19:54:57 2013 +0000
@@ -32,6 +32,7 @@
         char buffer[256];
         
         // HTTP is statusline + headers + \r\n + body
+        // HTTP requires statusline and all headers to have "\r\n" at the end
         // 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>"};