Ben Gordon
/
ELEC351_GroupA_alternate
temp
Diff: NetWorking.hpp
- Revision:
- 0:2a4af0cb6e8d
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/NetWorking.hpp Thu Dec 06 15:38:09 2018 +0000 @@ -0,0 +1,50 @@ +#if !FEATURE_LWIP + #error [NOT_SUPPORTED] LWIP not supported for this target +#endif + +#include "mbed.h" +#include "EthernetInterface.h" +#include "TCPServer.h" +#include "TCPSocket.h" +#include <iostream> +#include <string> + +#define HTTP_STATUS_LINE "HTTP/1.0 200 OK" +#define HTTP_HEADER_FIELDS "Content-Type: text/html; charset=utf-8" +#define HTTP_MESSAGE_BODY1 "" \ +"<html>" "\n\r" \ +"<head>" "\n\r" \ +" <meta charset=\"utf-8\">" "\n\r" \ +" <title> ELEC 351 </title>" "\n\r" \ +" <meta http-equiv=\"refresh\" content=\"10\">" "\n\r" \ +"</head>" "\n\r" \ +"<body style=\"display:flex;text-align:center\" bgcolor=\"black\" text=\"white\">" "\n\r" \ +" <div style=\"margin:auto\">" "\n\r" \ +" <h1> Low Power Enviromental Sensor : Network Conection </h1>" "\n\r"\ +" <p> The Light value is " + +#define HTTP_MESSAGE_BODY2 "" \ +" </p>" "\n\r" \ +" <p> The Temp value is " + +#define HTTP_MESSAGE_BODY3 "" \ +" </p>" "\n\r" \ +" <p> The Pressure value is " + +#define HTTP_CLOSE "" \ +" </p>" "\n\r" \ +" </div>" "\n\r" \ +"</body>" "\n\r" \ +"</html>" + +#define HTTP_RESPONSE HTTP_STATUS_LINE "\r\n" \ + HTTP_HEADER_FIELDS "\r\n" \ + "\r\n" \ + HTTP_MESSAGE_BODY "\r\n" + +#define IP "10.0.0.10" +#define NETMASK "255.0.0.0" +#define GATEWAY "10.0.0.1" + +void NetWorkingThread(void); +