⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 group__xg_c_g_i.html

📁 针对AVR单片机开发的嵌入式操作系统
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head>    <meta name="robots" content="noindex">    <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">    <title>Ethernut WebPort</title>    <link href="doxygen.css" rel="stylesheet" type="text/css"></head><body bgcolor="#ffffff"><!-- Generated by Doxygen 1.4.1 --><div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a></div><h1>CGI Routines</h1>CGI request handler and dynamic HTML builder.  <a href="#_details">More...</a><table border="0" cellpadding="0" cellspacing="0"><tr><td></td></tr><tr><td colspan="2"><br><h2>Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">static void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xg_c_g_i.html#ga4">HtmlLedRow</a> (FILE *stream, u_char num, u_char desc, u_long ival, u_long oval, u_long dir)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Print HTML code for a row of LEDs.  <a href="#ga4"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">static void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xg_c_g_i.html#ga5">HtmlCheckboxRow</a> (FILE *stream, u_char num, u_char desc, u_char *name, u_long check, u_long enable)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Print HTML code for a row of checkboxes.  <a href="#ga5"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">static void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xg_c_g_i.html#ga6">HtmlSeparatorRow</a> (FILE *stream, u_char width, u_char height)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Print HTML code for a separator row.  <a href="#ga6"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">static void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xg_c_g_i.html#ga7">HtmlInOutPortRow</a> (FILE *stream, char name, u_char pin, u_char port, u_char ddr, u_char enable)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Print HTML code to display a single I/O port.  <a href="#ga7"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">static void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xg_c_g_i.html#ga8">ProcessCgiPortRequest</a> (REQUEST *req)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Process request parameters for CPU port control.  <a href="#ga8"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">static void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xg_c_g_i.html#ga9">ProcessCgiRelayRequest</a> (char *query)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Process request parameters for relay output control.  <a href="#ga9"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xg_c_g_i.html#ga10">CpuPortControl</a> (FILE *stream, REQUEST *req)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">CGI callback function to control the CPU ports.  <a href="#ga10"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xg_c_g_i.html#ga11">CpuPortStatus</a> (FILE *stream, REQUEST *req)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">CGI callback function to display the status of the CPU ports.  <a href="#ga11"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xg_c_g_i.html#ga12">SpiRelayControl</a> (FILE *stream, REQUEST *req)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">CGI callback function to control a shift register output board.  <a href="#ga12"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xg_c_g_i.html#ga13">SpiOptoStatus</a> (FILE *stream, REQUEST *req)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">CGI callback function to query a shift register input board.  <a href="#ga13"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xg_c_g_i.html#ga14">CharonLedControl</a> (FILE *stream, REQUEST *req)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">CGI callback function to control the Charon II LEDs.  <a href="#ga14"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xg_c_g_i.html#ga15">CharonSwitchStatus</a> (FILE *stream, REQUEST *req)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">CGI callback function to query the Charon II switches.  <a href="#ga15"></a><br></td></tr><tr><td colspan="2"><br><h2>Variables</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga0" doxytag="xgCGI::spi_ni"></a>static u_char&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xg_c_g_i.html#ga0">spi_ni</a> = 255</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Number of detected opto inputs. <br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga1" doxytag="xgCGI::spi_no"></a>static u_char&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xg_c_g_i.html#ga1">spi_no</a> = 255</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Number of detected relays. <br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga2" doxytag="xgCGI::relay_status"></a>static u_long&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xg_c_g_i.html#ga2">relay_status</a></td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Relays status. <br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga3" doxytag="xgCGI::relay_known"></a>static u_char&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xg_c_g_i.html#ga3">relay_known</a></td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Equals zero as long as the relay status is unknown. <br></td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2>CGI request handler and dynamic HTML builder. <p>This module contains all registered CGI functions and some routines to dynamically create the webpages. <hr><h2>Function Documentation</h2><a class="anchor" name="ga14" doxytag="cgi.c::CharonLedControl"></a><p><table class="mdTable" cellpadding="2" cellspacing="0">  <tr>    <td class="mdRow">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top">int CharonLedControl           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">FILE *&nbsp;</td>          <td class="mdname" nowrap> <em>stream</em>, </td>        </tr>        <tr>          <td class="md" nowrap align="right"></td>          <td class="md"></td>          <td class="md" nowrap>REQUEST *&nbsp;</td>          <td class="mdname" nowrap> <em>req</em></td>        </tr>        <tr>          <td class="md"></td>          <td class="md">)&nbsp;</td>          <td class="md" colspan="2"></td>        </tr>      </table>    </td>  </tr></table><table cellspacing="5" cellpadding="0" border="0">  <tr>    <td>      &nbsp;    </td>    <td><p>CGI callback function to control the Charon II LEDs. <p>Creates HTML code to show the status of any attached shift register output board plus a HTML form to modify the current relay status via checkboxes.<p>The resulting HTML code is send back to the browser. If the submit button is clicked on this page, this function will be called again to process the checkboxes and display the updated status.<p><div align="center"><img src="relay.gif" alt="relay.gif"></div><p>This function is called by the HTTP module when a browser requests a CGI function, for which this routine has been registered via NutRegisterCgi().<p><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"></td><td valign="top"><em>stream</em>&nbsp;</td><td>Stream device of the HTTP connection. </td></tr>    <tr><td valign="top"></td><td valign="top"><em>req</em>&nbsp;</td><td>Pointer to the CGI REQUEST structure. Detailed information is available in the Nut/OS API documentation.</td></tr>  </table></dl><dl compact><dt><b>Returns:</b></dt><dd>0 on success or -1 in case of any failure. </dd></dl><p>Definition at line <a class="el" href="cgi_8c-source.html#l00610">610</a> of file <a class="el" href="cgi_8c-source.html">cgi.c</a>.<p>References <a class="el" href="webport_8h-source.html#l00069">CHARON_CONTROL_CGI</a>, <a class="el" href="cgi_8c-source.html#l00140">HtmlCheckboxRow()</a>, and <a class="el" href="cgi_8c-source.html#l00093">HtmlLedRow()</a>.<p>Referenced by <a class="el" href="webport_8c-source.html#l00260">main()</a>.    </td>  </tr></table><a class="anchor" name="ga15" doxytag="cgi.c::CharonSwitchStatus"></a><p><table class="mdTable" cellpadding="2" cellspacing="0">  <tr>    <td class="mdRow">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top">int CharonSwitchStatus           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">FILE *&nbsp;</td>          <td class="mdname" nowrap> <em>stream</em>, </td>        </tr>        <tr>          <td class="md" nowrap align="right"></td>          <td class="md"></td>          <td class="md" nowrap>REQUEST *&nbsp;</td>          <td class="mdname" nowrap> <em>req</em></td>        </tr>        <tr>          <td class="md"></td>          <td class="md">)&nbsp;</td>          <td class="md" colspan="2"></td>        </tr>      </table>    </td>  </tr></table><table cellspacing="5" cellpadding="0" border="0">  <tr>    <td>      &nbsp;    </td>    <td><p>CGI callback function to query the Charon II switches. <p>This function is called by the HTTP helper routines when a browser requests a CGI function, for which this routine has been registered via NutRegisterCgi().<p><div align="center"><img src="opto.gif" alt="opto.gif"></div><p>Creates HTML code to show the status of the optically isolated inputs of an attached SPI input board. The page will be automatically refreshed every 5 seconds.<p><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"></td><td valign="top"><em>stream</em>&nbsp;</td><td>Stream device of the HTTP connection. </td></tr>    <tr><td valign="top"></td><td valign="top"><em>req</em>&nbsp;</td><td>Pointer to the CGI REQUEST structure. Detailed information is available in the Nut/OS API documentation.</td></tr>  </table></dl><dl compact><dt><b>Returns:</b></dt><dd>0 on success or -1 in case of any failure. </dd></dl><p>Definition at line <a class="el" href="cgi_8c-source.html#l00689">689</a> of file <a class="el" href="cgi_8c-source.html">cgi.c</a>.<p>References <a class="el" href="webport_8h-source.html#l00070">CHARON_STATUS_CGI</a>, and <a class="el" href="cgi_8c-source.html#l00093">HtmlLedRow()</a>.<p>Referenced by <a class="el" href="webport_8c-source.html#l00260">main()</a>.    </td>  </tr></table><a class="anchor" name="ga10" doxytag="cgi.c::CpuPortControl"></a><p><table class="mdTable" cellpadding="2" cellspacing="0">  <tr>    <td class="mdRow">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top">int CpuPortControl           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">FILE *&nbsp;</td>          <td class="mdname" nowrap> <em>stream</em>, </td>        </tr>        <tr>          <td class="md" nowrap align="right"></td>          <td class="md"></td>          <td class="md" nowrap>REQUEST *&nbsp;</td>          <td class="mdname" nowrap> <em>req</em></td>        </tr>        <tr>          <td class="md"></td>          <td class="md">)&nbsp;</td>          <td class="md" colspan="2"></td>        </tr>      </table>    </td>  </tr></table><table cellspacing="5" cellpadding="0" border="0">  <tr>    <td>      &nbsp;    </td>    <td><p>CGI callback function to control the CPU ports. <p>Creates HTML code to show the status of CPU ports B, D, E and F plus a HTML form to modify the port and data direction registers of ports B, D and E by checkboxes.<p>The resulting HTML code is send back to the browser. If the submit button is clicked on this page, this function will be called again to process the checkboxes.<p><div align="center"><img src="cport.gif" alt="cport.gif"></div><p>This function is called by the HTTP module when a browser requests a CGI function, for which this routine has been registered via NutRegisterCgi().<p><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"></td><td valign="top"><em>stream</em>&nbsp;</td><td>Stream of the HTTP connection. </td></tr>    <tr><td valign="top"></td><td valign="top"><em>req</em>&nbsp;</td><td>Pointer to the CGI REQUEST structure. Detailed information is available in the Nut/OS API documentation.</td></tr>  </table></dl><dl compact><dt><b>Returns:</b></dt><dd>0 on success or -1 in case of any failure. </dd></dl><p>Definition at line <a class="el" href="cgi_8c-source.html#l00330">330</a> of file <a class="el" href="cgi_8c-source.html">cgi.c</a>.<p>References <a class="el" href="cgi_8c-source.html#l00195">HtmlInOutPortRow()</a>, <a class="el" href="cgi_8c-source.html#l00093">HtmlLedRow()</a>, <a class="el" href="cgi_8c-source.html#l00170">HtmlSeparatorRow()</a>, <a class="el" href="webport_8h-source.html#l00065">PORT_CONTROL_CGI</a>, and <a class="el" href="cgi_8c-source.html#l00225">ProcessCgiPortRequest()</a>.<p>Referenced by <a class="el" href="webport_8c-source.html#l00260">main()</a>.    </td>  </tr></table><a class="anchor" name="ga11" doxytag="cgi.c::CpuPortStatus"></a><p><table class="mdTable" cellpadding="2" cellspacing="0">  <tr>    <td class="mdRow">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top">int CpuPortStatus           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">FILE *&nbsp;</td>          <td class="mdname" nowrap> <em>stream</em>, </td>        </tr>        <tr>          <td class="md" nowrap align="right"></td>          <td class="md"></td>          <td class="md" nowrap>REQUEST *&nbsp;</td>          <td class="mdname" nowrap> <em>req</em></td>        </tr>        <tr>          <td class="md"></td>          <td class="md">)&nbsp;</td>          <td class="md" colspan="2"></td>        </tr>      </table>    </td>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -