Functions | |
| void | HtmlLedRow (FILE *stream, u_char num, u_char desc, u_long ival, u_long oval, u_long dir) |
| Print HTML code for a row of LEDs. | |
| void | HtmlCheckboxRow (FILE *stream, u_char num, u_char desc, u_char *name, u_long check, u_long enable) |
| Print HTML code for a row of checkboxes. | |
| void | HtmlSeparatorRow (FILE *stream, u_char width, u_char height) |
| Print HTML code for a separator row. | |
| void | HtmlInOutPortRow (FILE *stream, char name, u_char pin, u_char port, u_char ddr, u_char enable) |
| Print HTML code to display a single I/O port. | |
| void | ProcessCgiPortRequest (char *query) |
| Process request parameters for CPU port control. | |
| void | ProcessCgiRelayRequest (char *query) |
| Process request parameters for relay output control. | |
| int | CpuPortControl (FILE *stream, REQUEST *req) |
| CGI callback function to control the CPU ports. | |
| int | CpuPortStatus (FILE *stream, REQUEST *req) |
| CGI callback function to display the status of the CPU ports. | |
| int | SpiRelayControl (FILE *stream, REQUEST *req) |
| CGI callback function to control a SPI relay output board. | |
| int | SpiOptoStatus (FILE *stream, REQUEST *req) |
| CGI callback function to control a SPI input board. | |
Variables | |
| u_char | spi_ni = 255 |
| Number of detected opto inputs. | |
| u_char | spi_no = 255 |
| Number of detected relays. | |
| u_long | relay_status |
| Relays status. | |
| u_char | relay_known |
| Equals zero as long as the relay status is unknown. | |
This module contains all registered CGI functions and some routines to dynamically create the webpages.
|
||||||||||||
|
CGI callback function to control the CPU ports. 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. 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.
Definition at line 319 of file cgi.c. References HtmlInOutPortRow(), HtmlLedRow(), HtmlSeparatorRow(), PORT_CONTROL_CGI, and ProcessCgiPortRequest(). Referenced by main(). |
|
||||||||||||
|
CGI callback function to display the status of the CPU ports. Creates HTML code to show the status of CPU ports B, D, E and F. The page will be automatically refreshed once a second.
Definition at line 386 of file cgi.c. References HtmlLedRow(), and PORT_STATUS_CGI. Referenced by main(). |
|
||||||||||||||||||||||||||||
|
Print HTML code for a row of checkboxes. The resulting HTML code will present a row of checkboxes.
Definition at line 139 of file cgi.c. Referenced by HtmlInOutPortRow(), and SpiRelayControl(). |
|
||||||||||||||||||||||||||||
|
Print HTML code to display a single I/O port. The resulting HTML code will present a row of LEDs and two rows of checkboxes. While the LEDs show the current port status, the checkboxes may be used to modify the port output and the data direction register. See HtmlLedRow() for further details about how LEDs are displayed. The checkboxes are created by calling HtmlCheckboxRow().
Definition at line 196 of file cgi.c. References HtmlCheckboxRow(), and HtmlLedRow(). Referenced by CpuPortControl(). |
|
||||||||||||||||||||||||||||
|
Print HTML code for a row of LEDs. The resulting HTML code will present a row of LEDs. The color and the lit state of each LED is determined by three bit values. The required images are expected in the URL root of the urom flash filesystem:
All LED images must be of the same size, 28 x 28 pixels.
Definition at line 89 of file cgi.c. Referenced by CpuPortControl(), CpuPortStatus(), HtmlInOutPortRow(), SpiOptoStatus(), and SpiRelayControl(). |
|
||||||||||||||||
|
Print HTML code for a separator row. The resulting HTML code will present a black row.
Definition at line 171 of file cgi.c. Referenced by CpuPortControl(). |
|
|
Process request parameters for CPU port control. Parse the CGI query and perform the corresponding action:
All other bits are switched off.
Definition at line 226 of file cgi.c. Referenced by CpuPortControl(). |
|
|
Process request parameters for relay output control. Parse the CGI query and switch the corresponding relays. 'S=y' will switch on relay y. All other relays are switched off. Note, that before calling this function is called for the first time, the status of the relays is unknown.
Definition at line 277 of file cgi.c. References relay_known, relay_status, and spi_no. Referenced by SpiRelayControl(). |
|
||||||||||||
|
CGI callback function to control a SPI input board. Creates HTML code to show the status of the optically isolated inputs of an attached SPI input board. The page will be automatically refreshed once a second.
Definition at line 528 of file cgi.c. References HtmlLedRow(), OPTO_STATUS_CGI, spi_ni, and spi_no. Referenced by main(). |
|
||||||||||||
|
CGI callback function to control a SPI relay output board. Creates HTML code to show the status of any attached SPI relay output board plus a HTML form to modify the current relay status via checkboxes. 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.
Definition at line 453 of file cgi.c. References HtmlCheckboxRow(), HtmlLedRow(), ProcessCgiRelayRequest(), RELAY_CONTROL_CGI, relay_known, relay_status, spi_ni, and spi_no. Referenced by main(). |