A simple web server that can be bound to either the EthernetInterface or the WiflyInterface.
Dependents: Smart-WiFly-WebServer WattEye X10Svr SSDP_Server
Diff: SW_HTTPServer.h
- Revision:
- 21:660143f20b04
- Parent:
- 18:6199558632c0
- Child:
- 22:55974de690c1
- Child:
- 24:062431453abb
--- a/SW_HTTPServer.h Sat Sep 14 22:41:20 2013 +0000 +++ b/SW_HTTPServer.h Thu Sep 26 23:47:50 2013 +0000 @@ -27,6 +27,13 @@ #define MAX_HEADER_SIZE 1000 +/// INCLUDE_GETREMOTE is used for backward compatibility, however +/// this makes the server dependent on the WiFly module. By not +/// defining this, the web server can be more readily adapted to +/// a wired interface using EthernetInterface. +//#define INCLUDE_GETREMOTE + + /// HTTPServer is a simple web server using the WiFly module. /// /// While simple, it is a capable, web server. The basic mode @@ -393,6 +400,8 @@ */ void UnescapeString(char * encoded); + +#ifdef INCLUDE_GETREMOTE /** * Get the IP address of the remote node to which we are connected. * @@ -401,6 +410,10 @@ * "192.168.100.234" format. If the buffer size is note >= 16 bytes, * it will set the buffer to null. * + * @deprecated This binds the web server to only network interfaces + * that support this API (WiFly), so can limit its use. + * This API will be removed. + * * @note This switches the module into, and out of, command mode * which has quite a time penalty. * @@ -410,6 +423,7 @@ * @returns true if it succeeded, false otherwise */ bool GetRemoteAddr(char * str, int strSize); +#endif /** * This is used to force a connection to close. @@ -553,10 +567,6 @@ char * queryType; char * queryString; -// char * hostString; -// char * contentLength; -// char * contentType; -// char * authorization; char * postQueryString; /**