monitor sensor and control relay via web server

Dependencies:   WIZWebtInterface mbed

Fork of HTTP_Test_Server_Web by root root

Committer:
846354866
Date:
Wed Nov 16 06:16:59 2016 +0000
Revision:
4:f975091219a2
Parent:
3:dc786e394e82

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
846354866 3:dc786e394e82 1 static char ledSc[4][7] = {"open.", "FF0000", "close", "000000"};
846354866 3:dc786e394e82 2 static char html[3072]={0};
846354866 3:dc786e394e82 3 void htmlWeb(int Temp,int tempW,int Hum,int humW,int Gas,float gasW,char* Led,char* ledS,char* ip)
846354866 3:dc786e394e82 4 {
846354866 3:dc786e394e82 5 sprintf(html, "<!DOCTYPE html PUBLIC '-//DTD HTML 4.01//EN' 'http://www.dfrobot.com.cn'>\
846354866 3:dc786e394e82 6 <html>\
846354866 3:dc786e394e82 7 <body bgcolor='#cccc99'></body>\
846354866 3:dc786e394e82 8 <head><title>Hi DFrobot</title></head>\
846354866 3:dc786e394e82 9 <h1>W7500P Data Monitor</h1>\
846354866 3:dc786e394e82 10 <hr style='width: 300; height: 2px;'>\
846354866 3:dc786e394e82 11 \
846354866 3:dc786e394e82 12 <table style='width: 500px; height: 30px;' border='1' cellpadding='2' cellspacing='2'>\
846354866 3:dc786e394e82 13 <tbody>\
846354866 3:dc786e394e82 14 <tr>\
846354866 3:dc786e394e82 15 <td style='font-family: Verdana; font-weight: bold; font-style: italic; background-color: rgb(100, 100, 255); text-align: center;'><small>\
846354866 3:dc786e394e82 16 <span style='color: white;'>Data&Control\
846354866 3:dc786e394e82 17 </span></small></td>\
846354866 3:dc786e394e82 18 </tr>\
846354866 3:dc786e394e82 19 </tbody>\
846354866 3:dc786e394e82 20 </table>\
846354866 3:dc786e394e82 21 \
846354866 3:dc786e394e82 22 <tbody>\
846354866 3:dc786e394e82 23 <table bgcolor='#cccccc' border='1' cellpadding='0' cellspacing='0' width='500' height='22';>Temperature:%d Celsius\
846354866 3:dc786e394e82 24 <tbody><tr><td>\
846354866 3:dc786e394e82 25 <table border='0' cellpadding='0' cellspacing='0' width='%d'>\
846354866 3:dc786e394e82 26 <td bgcolor='#33ff00'>&nbsp;\
846354866 3:dc786e394e82 27 </td></tr></tbody>\
846354866 3:dc786e394e82 28 </table>\
846354866 3:dc786e394e82 29 </tbody>\
846354866 3:dc786e394e82 30 \
846354866 3:dc786e394e82 31 <tbody>\
846354866 3:dc786e394e82 32 <table bgcolor='#cccccc' border='1' cellpadding='0' cellspacing='0' width='500' height='22';><p></p>Humidity:%d%%\
846354866 3:dc786e394e82 33 <tbody><tr><td>\
846354866 3:dc786e394e82 34 <table border='0' cellpadding='0' cellspacing='0' width='%d'>\
846354866 3:dc786e394e82 35 <td bgcolor='#33ff00'>&nbsp;\
846354866 3:dc786e394e82 36 </td></tr></tbody>\
846354866 3:dc786e394e82 37 </table>\
846354866 3:dc786e394e82 38 </tbody>\
846354866 3:dc786e394e82 39 \
846354866 3:dc786e394e82 40 <tbody>\
846354866 3:dc786e394e82 41 <table bgcolor='#cccccc' border='1' cellpadding='0' cellspacing='0' width='500' height='22';><p></p>Gas Value:%d\
846354866 3:dc786e394e82 42 <tbody><tr><td>\
846354866 3:dc786e394e82 43 <table border='0' cellpadding='0' cellspacing='0' width='%.0f'>\
846354866 3:dc786e394e82 44 <td bgcolor='#33ff00'>&nbsp;\
846354866 3:dc786e394e82 45 </td></tr></tbody>\
846354866 3:dc786e394e82 46 </table>\
846354866 3:dc786e394e82 47 </tbody>\
846354866 3:dc786e394e82 48 \
846354866 3:dc786e394e82 49 <tbody>\
846354866 3:dc786e394e82 50 <table bgcolor='#cccccc' border='1' cellpadding='0' cellspacing='0' height='20';><p></p>Led state:%s\
846354866 3:dc786e394e82 51 <tbody><tr><td>\
846354866 3:dc786e394e82 52 <table border='0' cellpadding='0' cellspacing='0' width='115'>\
846354866 3:dc786e394e82 53 <td bgcolor='#%s'>&nbsp;\
846354866 3:dc786e394e82 54 </td></tr></tbody>\
846354866 3:dc786e394e82 55 </table>\
846354866 3:dc786e394e82 56 </tbody>\
846354866 3:dc786e394e82 57 \
846354866 3:dc786e394e82 58 <tbody>\
846354866 3:dc786e394e82 59 <table border='0' width='600'>\
846354866 3:dc786e394e82 60 <tbody><tr>\
846354866 3:dc786e394e82 61 <td width='0'></td>\
846354866 3:dc786e394e82 62 <hr />\
846354866 3:dc786e394e82 63 </tr></tbody>\
846354866 3:dc786e394e82 64 </table>\
846354866 3:dc786e394e82 65 </tbody>\
846354866 3:dc786e394e82 66 \
846354866 3:dc786e394e82 67 <tbody>\
846354866 3:dc786e394e82 68 <table style='width: 130px; color: #873422; height: 30px;'>\
846354866 3:dc786e394e82 69 <tbody><tr>\
846354866 3:dc786e394e82 70 <td ><big><big><font size='-1'><big><big><strong>LED control</font></big></big></td>\
846354866 3:dc786e394e82 71 </tr></tbody>\
846354866 3:dc786e394e82 72 </table>\
846354866 3:dc786e394e82 73 \
846354866 3:dc786e394e82 74 <form action='http://%s'><H3>Led:<input type='submit' value='ON/OFF'><H3></form>\
846354866 3:dc786e394e82 75 </tbody>\
846354866 3:dc786e394e82 76 <meta http-equiv='refresh' content='2'>\
846354866 4:f975091219a2 77 </html>", Temp, tempW, Hum, humW, Gas, gasW, Led, ledS, ip);
846354866 3:dc786e394e82 78 }