web iot espressif

Dependencies:   WIZWebtInterface mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers wizHTML.h Source File

wizHTML.h

00001 static char ledSc[4][7] = {"open.", "FF0000", "close", "000000"};
00002 static char html[3072]={0};
00003 void htmlWeb(int Temp,int tempW,int Hum,int humW,int Gas,float gasW,char* Led,char* ledS,char* ip)
00004 {
00005     sprintf(html, "<!DOCTYPE html PUBLIC '-//DTD HTML 4.01//EN' 'http://www.dfrobot.com.cn'>\
00006         <html>\
00007         <body bgcolor='#cccc99'></body>\
00008         <head><title>Hi DFrobot</title></head>\
00009         <h1>W7500P Data Monitor</h1>\
00010         <hr style='width: 300; height: 2px;'>\
00011         \
00012         <table style='width: 500px; height: 30px;' border='1' cellpadding='2' cellspacing='2'>\
00013         <tbody>\
00014         <tr>\
00015         <td style='font-family: Verdana; font-weight: bold; font-style: italic; background-color: rgb(100, 100, 255); text-align: center;'><small>\
00016         <span style='color: white;'>Data&Control\
00017         </span></small></td>\
00018         </tr>\
00019         </tbody>\
00020         </table>\
00021         \
00022         <tbody>\
00023         <table bgcolor='#cccccc' border='1' cellpadding='0' cellspacing='0' width='500' height='22';>Temperature:%d Celsius\
00024         <tbody><tr><td>\
00025         <table border='0' cellpadding='0' cellspacing='0' width='%d'>\
00026         <td bgcolor='#33ff00'>&nbsp;\
00027         </td></tr></tbody>\
00028         </table>\
00029         </tbody>\
00030         \
00031         <tbody>\
00032         <table bgcolor='#cccccc' border='1' cellpadding='0' cellspacing='0' width='500' height='22';><p></p>Humidity:%d%%\
00033         <tbody><tr><td>\
00034         <table border='0' cellpadding='0' cellspacing='0' width='%d'>\
00035         <td bgcolor='#33ff00'>&nbsp;\
00036         </td></tr></tbody>\
00037         </table>\
00038         </tbody>\
00039         \
00040         <tbody>\
00041         <table bgcolor='#cccccc' border='1' cellpadding='0' cellspacing='0' width='500' height='22';><p></p>Gas Value:%d\
00042         <tbody><tr><td>\
00043         <table border='0' cellpadding='0' cellspacing='0' width='%.0f'>\
00044         <td bgcolor='#33ff00'>&nbsp;\
00045         </td></tr></tbody>\
00046         </table>\
00047         </tbody>\
00048         \
00049         <tbody>\
00050         <table bgcolor='#cccccc' border='1' cellpadding='0' cellspacing='0' height='20';><p></p>Led state:%s\
00051         <tbody><tr><td>\
00052         <table border='0' cellpadding='0' cellspacing='0' width='115'>\
00053         <td bgcolor='#%s'>&nbsp;\
00054         </td></tr></tbody>\
00055         </table>\
00056         </tbody>\
00057         \
00058         <tbody>\
00059         <table border='0' width='600'>\
00060         <tbody><tr>\
00061         <td width='0'></td>\
00062         <hr />\
00063         </tr></tbody>\
00064         </table>\
00065         </tbody>\
00066         \
00067         <tbody>\
00068         <table style='width: 130px; color: #873422; height: 30px;'>\
00069         <tbody><tr>\
00070         <td ><big><big><font size='-1'><big><big><strong>LED control</font></big></big></td>\
00071         </tr></tbody>\
00072         </table>\
00073         \
00074         <form action='http://%s'><H3>Led:<input type='submit' value='ON/OFF'><H3></form>\
00075         </tbody>\
00076         <meta http-equiv='refresh' content='2'>\
00077         </html>", Temp, tempW, Hum, humW, Gas, gasW, Led, ledS, ip);
00078 }