📄 web.c
字号:
0x7D,0x0D,0x0A,0x64,0x69,0x76,0x2E,0x6C,0x6F,0x67,0x6F,0x20,0x69,0x6D,0x67,
0x20,0x7B,0x68,0x65,0x69,0x67,0x68,0x74,0x3A,0x36,0x32,0x70,0x78,0x3B,0x20,
0x77,0x69,0x64,0x74,0x68,0x3A,0x32,0x30,0x39,0x70,0x78,0x3B,0x7D,0x0D,0x0A,
0x64,0x69,0x76,0x2E,0x72,0x75,0x6C,0x65,0x20,0x7B,0x62,0x61,0x63,0x6B,0x67,
0x72,0x6F,0x75,0x6E,0x64,0x3A,0x75,0x72,0x6C,0x28,0x72,0x75,0x6C,0x65,0x2E,
0x67,0x69,0x66,0x29,0x20,0x6E,0x6F,0x2D,0x72,0x65,0x70,0x65,0x61,0x74,0x3B,
0x20,0x68,0x65,0x69,0x67,0x68,0x74,0x3A,0x33,0x70,0x78,0x3B,0x20,0x77,0x69,
0x64,0x74,0x68,0x3A,0x35,0x38,0x30,0x70,0x78,0x3B,0x7D,0x0D,0x0A,0x64,0x69,
0x76,0x2E,0x62,0x75,0x74,0x74,0x6F,0x6E,0x73,0x20,0x7B,0x74,0x65,0x78,0x74,
0x2D,0x61,0x6C,0x69,0x67,0x6E,0x3A,0x63,0x65,0x6E,0x74,0x65,0x72,0x3B,0x7D,
0x0D,0x0A,0x64,0x69,0x76,0x2E,0x62,0x75,0x74,0x74,0x6F,0x6E,0x73,0x20,0x61,
0x20,0x7B,0x62,0x61,0x63,0x6B,0x67,0x72,0x6F,0x75,0x6E,0x64,0x2D,0x63,0x6F,
0x6C,0x6F,0x72,0x3A,0x23,0x66,0x66,0x66,0x66,0x66,0x66,0x3B,0x20,0x62,0x6F,
0x72,0x64,0x65,0x72,0x3A,0x73,0x6F,0x6C,0x69,0x64,0x20,0x31,0x70,0x78,0x20,
0x23,0x65,0x35,0x65,0x34,0x65,0x34,0x3B,0x20,0x63,0x6F,0x6C,0x6F,0x72,0x3A,
0x23,0x37,0x62,0x62,0x31,0x64,0x62,0x3B,0x20,0x66,0x6F,0x6E,0x74,0x2D,0x77,
0x65,0x69,0x67,0x68,0x74,0x3A,0x62,0x6F,0x6C,0x64,0x3B,0x20,0x6D,0x61,0x72,
0x67,0x69,0x6E,0x2D,0x72,0x69,0x67,0x68,0x74,0x3A,0x31,0x30,0x70,0x78,0x3B,
0x20,0x70,0x61,0x64,0x64,0x69,0x6E,0x67,0x3A,0x32,0x70,0x78,0x20,0x35,0x70,
0x78,0x20,0x32,0x70,0x78,0x20,0x35,0x70,0x78,0x3B,0x7D,0x0D,0x0A,0x64,0x69,
0x76,0x2E,0x62,0x75,0x74,0x74,0x6F,0x6E,0x73,0x20,0x61,0x3A,0x68,0x6F,0x76,
0x65,0x72,0x20,0x7B,0x62,0x61,0x63,0x6B,0x67,0x72,0x6F,0x75,0x6E,0x64,0x2D,
0x63,0x6F,0x6C,0x6F,0x72,0x3A,0x23,0x37,0x62,0x62,0x31,0x64,0x62,0x3B,0x20,
0x63,0x6F,0x6C,0x6F,0x72,0x3A,0x23,0x66,0x66,0x66,0x66,0x66,0x66,0x3B,0x7D,
0x0D,0x0A,0x64,0x69,0x76,0x2E,0x63,0x6F,0x70,0x79,0x72,0x69,0x67,0x68,0x74,
0x20,0x7B,0x63,0x6F,0x6C,0x6F,0x72,0x3A,0x23,0x38,0x65,0x38,0x65,0x38,0x65,
0x3B,0x20,0x66,0x6F,0x6E,0x74,0x2D,0x73,0x69,0x7A,0x65,0x3A,0x31,0x30,0x70,
0x78,0x3B,0x20,0x74,0x65,0x78,0x74,0x2D,0x61,0x6C,0x69,0x67,0x6E,0x3A,0x63,
0x65,0x6E,0x74,0x65,0x72,0x3B,0x7D,
};
/*---------------------------------------------------------------------------*/
const U8 rule_gif[] = {
0x47,0x49,0x46,0x38,0x39,0x61,0x44,0x02,0x03,0x00,0xA2,0x00,0x00,0xF9,0xB5,
0x00,0xC9,0xD2,0x00,0x7B,0xB1,0xDB,0x7E,0x96,0x3D,0x8F,0x82,0x3E,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2C,0x00,0x00,0x00,0x00,0x44,0x02,0x03,
0x00,0x00,0x03,0x6E,0x08,0xBA,0xDC,0xFE,0x30,0xCA,0x49,0xAB,0xBD,0x38,0xEB,
0x49,0xBA,0xFF,0x60,0x28,0x8E,0x64,0x09,0x0A,0x68,0xAA,0xAE,0x6C,0xEB,0xBE,
0x70,0x2C,0xCF,0x34,0x3C,0xDC,0x78,0xAE,0xEF,0x7C,0xEF,0xFF,0xBD,0x80,0x70,
0x48,0x2C,0x1A,0x8F,0xC8,0xA4,0x72,0xC9,0x6C,0x3A,0x9F,0xD0,0xE8,0x71,0x43,
0xAD,0x5A,0xAF,0xD8,0xAC,0x56,0x61,0xEA,0x7A,0xBF,0xA5,0x9A,0x78,0x4C,0x2E,
0x9B,0x6D,0xC0,0xB4,0x7A,0x9D,0x96,0xBA,0xDF,0xF0,0xB8,0x7C,0xDE,0xDC,0xDA,
0xEF,0xF8,0xBC,0xBE,0x01,0xEE,0xFB,0xBB,0x67,0x81,0x82,0x83,0x84,0x6C,0x86,
0x87,0x6C,0x74,0x8A,0x8B,0x8C,0x8D,0x74,0x09,0x00,0x3B,
};
/*---------------------------------------------------------------------------*/
const U8 network_cgi[] = {
"#=====================================================================================\r\n"
"# ----- This is a TcpNet Script file which runs on TcpNet -------\r\n"
"# It generates a dynamic page to edit/change IP address, Net mask and Default"
" Gateway\r\n"
"#=====================================================================================\r\n"
"t <html>\r\n"
"t <head>\r\n"
"t <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\r\n"
"t <title>NXP Semiconductors - Embedded Web Server Network Settings</title>\r\n"
"t <meta name=\"author\" content=\"NXP Semiconductors\" />\r\n"
"t <meta name=\"language\" content=\"en-US\" />\r\n"
"t <link type=\"text/css\" rel=\"stylesheet\" href=\"nxp.css\" />\r\n"
"t </head>\r\n"
"t <body>\r\n"
"t <div class=\"logo\"><a href=\"index.htm\"><img src=\"logo.gif\" alt=\"\" /></a></div>\r\n"
"t <div class=\"rule\"></div>\r\n"
"t <h1>Embedded Web Server Network Settings</h1>\r\n"
"t <FORM ACTION=network.cgi METHOD=GET NAME=CGI>\r\n"
"t <INPUT TYPE=HIDDEN VALUE=\"net\" NAME=pg>\r\n"
"t <TABLE BORDER=0 WIDTH=99%>\r\n"
"t <TR BGCOLOR=#aaccff>\r\n"
"t <TH WIDTH=40%>Item</TH>\r\n"
"t <TH WIDTH=60%>Setting</TH></TR>\r\n"
"# Here begin data setting which is formatted in HTTP_CGI.C module\r\n"
"t <TR><TD><IMG SRC=pabb.gif>LAN IP Address</TD>\r\n"
"c a i <TD><INPUT TYPE=TEXT NAME=ip VALUE=\"%d.%d.%d.%d\" SIZE=18 MAXLENGTH=18></TD></TR>\r\n"
"t <TR><TD><IMG SRC=pabb.gif>LAN Net Mask</TD>\r\n"
"c a m <TD><INPUT TYPE=TEXT NAME=msk VALUE=\"%d.%d.%d.%d\" SIZE=18 MAXLENGTH=18></TD></TR>\r\n"
"t <TR><TD><IMG SRC=pabb.gif>Default Gateway</TD>\r\n"
"c a g <TD><INPUT TYPE=TEXT NAME=gw VALUE=\"%d.%d.%d.%d\" SIZE=18 MAXLENGTH=18></TD></TR>\r\n"
"t <TR><TD><IMG SRC=pabb.gif>Primary DNS Server</TD>\r\n"
"c a p <TD><INPUT TYPE=TEXT NAME=pdns VALUE=\"%d.%d.%d.%d\" SIZE=18 MAXLENGTH=18></TD></TR>\r\n"
"t <TR><TD><IMG SRC=pabb.gif>Secondary DNS Server</TD>\r\n"
"c a s <TD><INPUT TYPE=TEXT NAME=sdns VALUE=\"%d.%d.%d.%d\" SIZE=18 MAXLENGTH=18></TD></TR>\r\n"
"t <TR><TD> </TD><TD> </TD></TR><TR><TD></TD><TD align=\"right\">\r\n"
"# Here begin button definitions\r\n"
"t <INPUT TYPE=SUBMIT NAME=set VALUE=\"Change\" id=\"sbm\">\r\n"
"t <INPUT TYPE=RESET VALUE=\"Undo\">\r\n"
"t </TD></TR></TABLE></FORM>\r\n"
"t <p>This page allows you to change the system <b>IP address</b>, <b>Net Mask</b>,\r\n"
"t <b>Default Gateway</b>, Primary and Secondary <b>DNS Server</b>. After you"
" \r\n"
"t have changed the IP address, you need to modify the host IP address in you"
" Internet \r\n"
"t browser too to be able to connect to your TcpNet target. Make changes with"
" <b>care</b>\r\n"
"t or you may block the <b>TcpNet</b> sysetm. This Form uses a <b>GET</b> method"
" to send \r\n"
"t data back to a Web server. You need to click on <b>Change</b> button to activate"
" the \r\n"
"t channges.</p>\r\n"
"t <div class=\"rule\"></div>\r\n"
"t <div class=\"copyright\">\r\n"
"t ©2006 <a href=\"http://www.standardics.nxp.com/\">NXP Semiconductors</a>"
" (founded by Philips).\r\n"
"t All rights reserved.\r\n"
"t </div>\r\n"
"t </BODY></HTML>\r\n"
"# This is end of script. It must be closed with period.\r\n"
".\r\n"
};
/*---------------------------------------------------------------------------*/
const U8 leds_cgi[] = {
"#================================================================\r\n"
"# ----- This is a TcpNet Script file which runs on TcpNet -------\r\n"
"# It controls the on-board LED diodes using the Internet browser.\r\n"
"#================================================================\r\n"
"t <HTML>\r\n"
"t <head>\r\n"
"t <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\r\n"
"t <title>NXP Semiconductors - Embedded Web Server LED Control</title>\r\n"
"t <meta name=\"author\" content=\"NXP Semiconductors\" />\r\n"
"t <meta name=\"language\" content=\"en-US\" />\r\n"
"t <link type=\"text/css\" rel=\"stylesheet\" href=\"nxp.css\" />\r\n"
"t </head>\r\n"
"t <body>\r\n"
"t <div class=\"logo\"><a href=\"index.htm\"><img src=\"logo.gif\" alt=\"\" /></a></div>\r\n"
"t <div class=\"rule\"></div>\r\n"
"t <h1>Embedded Web Server LED Control</h1>\r\n"
"t <SCRIPT LANGUAGE=JavaScript> function AllSW(st) {\r\n"
"t for(i=0;i<document.form1.length;i++) {\r\n"
"t if(document.form1.elements[i].type==\"checkbox\"){\r\n"
"t document.form1.elements[i].checked=st;}}} </SCRIPT>\r\n"
"t <FORM ACTION=leds.cgi METHOD=POST NAME=form1>\r\n"
"t <INPUT TYPE=HIDDEN VALUE=\"led\" NAME=pg>\r\n"
"t <TABLE BORDER=0 WIDTH=99%>\r\n"
"t <TR BGCOLOR=#aaccff>\r\n"
"t <TH WIDTH=45%>Item</TH>\r\n"
"t <TH WIDTH=55%>Setting</TH></TR><TR>\r\n"
"t <TD><IMG SRC=pabb.gif>LED control:</TD><TD><SELECT NAME=\"ctrl\">\r\n"
"c b c <OPTION %s>Browser</OPTION><OPTION %s>Running Lights</OPTION></SELECT></TD></TR>\r\n"
"t <TR><TD><IMG SRC=pabb.gif>LED diodes on the output port</TD>\r\n"
"t <TD><table><tr valign=\"middle\">\r\n"
"# Here begin the 'checkbox' definitions\r\n"
"c b 7 <td><input type=checkbox name=led7 %s>7</td>\r\n"
"c b 6 <td><input type=checkbox name=led6 %s>6</td>\r\n"
"c b 5 <td><input type=checkbox name=led5 %s>5</td>\r\n"
"c b 4 <td><input type=checkbox name=led4 %s>4</td>\r\n"
"t <td width=\"5%\"></td>\r\n"
"c b 3 <td><input type=checkbox name=led3 %s>3</td>\r\n"
"c b 2 <td><input type=checkbox name=led2 %s>2</td>\r\n"
"c b 1 <td><input type=checkbox name=led1 %s>1</td>\r\n"
"c b 0 <td><input type=checkbox name=led0 %s>0</td>\r\n"
"t </table></TD></TR>\r\n"
"t <TR><TD><IMG SRC=pabb.gif>All LED diodes On or OFF</TD>\r\n"
"t <TD><INPUT TYPE=BUTTON VALUE=\" ON \" ONCLICK=\"AllSW(true)\">\r\n"
"t <INPUT TYPE=BUTTON VALUE=\" OFF \" ONcLICK=\"AllSW(false)\"></TD></TR>\r\n"
"t <TR><TD> </TD><TD> </TD></TR><TR><TD> </TD><TD align=\"right\">\r\n"
"t <INPUT TYPE=SUBMIT NAME=set VALUE=\"Submit\">\r\n"
"t <INPUT TYPE=RESET VALUE=\"Undo\">\r\n"
"t </TD></TR></TABLE></FORM>\r\n"
"t <p>This page shows you how to use the following http form <b>input</b> objects:\r\n"
"t <b>checkbox</b>, <b>select</b> and <b>button</b>. It uses also a simple <b>Java"
" Script</b>\r\n"
"t function to check/uncheck all checkboxes. This Form uses a <b>POST</b> method"
" to send data\r\n"
"t back to a Web server. You need to click on <b>Submit</b> button to activate"
" the channges.\r\n"
"t </p>\r\n"
"t <div class=\"rule\"></div>\r\n"
"t <div class=\"copyright\">\r\n"
"t ©2006 <a href=\"http://www.standardics.nxp.com/\">NXP Semiconductors</a>"
" (founded by Philips).\r\n"
"t All rights reserved.\r\n"
"t </div>\r\n"
"t </BODY></HTML>\r\n"
"# This is end of script. It must be closed with a period.\r\n"
".\r\n"
"\r\n"
};
/*---------------------------------------------------------------------------*/
const U8 lcd_cgi[] = {
"#=====================================================================================\r\n"
"# ----- This is a TcpNet Script file which runs on TcpNet -------\r\n"
"# It allows to change/send a text to on-board LCD Display Module \r\n"
"#=====================================================================================\r\n"
"t <html>\r\n"
"t <head>\r\n"
"t <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\r\n"
"t <title>NXP Semiconductors - Embedded Web Server LCD Control</title>\r\n"
"t <meta name=\"author\" content=\"NXP Semiconductors\" />\r\n"
"t <meta name=\"language\" content=\"en-US\" />\r\n"
"t <link type=\"text/css\" rel=\"stylesheet\" href=\"nxp.css\" />\r\n"
"t </head>\r\n"
"t <body>\r\n"
"t <div class=\"logo\"><a href=\"index.htm\"><img src=\"logo.gif\" alt=\"\" /></a></div>\r\n"
"t <div class=\"rule\"></div>\r\n"
"t <h1>Embedded Web Server LCD Control</h1>\r\n"
"t <FORM ACTION=lcd.cgi METHOD=POST NAME=CGI>\r\n"
"t <INPUT TYPE=HIDDEN VALUE=\"lcd\" NAME=pg>\r\n"
"t <TABLE BORDER=0 WIDTH=99%>\r\n"
"t <TR BGCOLOR=#aaccff>\r\n"
"t <TH WIDTH=40%>Item</TH>\r\n"
"t <TH WIDTH=60%>Setting</TH></TR>\r\n"
"# Here begin data setting which is formatted in HTTP_CGI.C module\r\n"
"t <TR><TD><IMG SRC=pabb.gif>Line 1 Text</TD>\r\n"
"c f 1 <TD><INPUT TYPE=TEXT NAME=lcd1 SIZE=16 MAXLENGTH=16 VALUE=\"%s\"></TD></TR>\r\n"
"t <TR><TD><IMG SRC=pabb.gif>Line 2 Text</TD>\r\n"
"c f 2 <TD><INPUT TYPE=TEXT NAME=lcd2 SIZE=16 MAXLENGTH=16 VALUE=\"%s\"></TD></TR>\r\n"
"t <TR><TD> </TD><TD> </TD></TR><TR><TD></TD><TD align=\"right\">\r\n"
"# Here begin button definitions\r\n"
"t <INPUT TYPE=SUBMIT NAME=set VALUE=\"Send\" id=\"sbm\">\r\n"
"t <INPUT TYPE=RESET VALUE=\"Undo\">\r\n"
"t </TD></TR></TABLE></FORM>\r\n"
"t <p>This page allows you to change a message displayed on <b>LCD Module</b>."
" Simply enter\r\n"
"t the text which you want to display on LCD module.\r\n"
"t This Form uses a <b>POST</b> method to send data back to a Web server. You"
" need to click\r\n"
"t on <b>Send</b> button to activate the channges.</p>\r\n"
"t <div class=\"rule\"></div>\r\n"
"t <div class=\"copyright\">\r\n"
"t ©2006 <a href=\"http://www.standardics.nxp.com/\">NXP Semiconductors</a>"
" (founded by Philips).\r\n"
"t All rights reserved.\r\n"
"t </div>\r\n"
"t </BODY></HTML>\r\n"
"# This is end of script. It must be closed with period.\r\n"
".\r\n"
};
/*---------------------------------------------------------------------------*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -