Functions | |
static 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. | |
static 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. | |
static void | HtmlSeparatorRow (FILE *stream, u_char width, u_char height) |
Print HTML code for a separator row. | |
static 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. | |
static void | ProcessCgiPortRequest (REQUEST *req) |
Process request parameters for CPU port control. | |
static 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 shift register output board. | |
int | SpiOptoStatus (FILE *stream, REQUEST *req) |
CGI callback function to query a shift register input board. | |
int | CharonLedControl (FILE *stream, REQUEST *req) |
CGI callback function to control the Charon II LEDs. | |
int | CharonSwitchStatus (FILE *stream, REQUEST *req) |
CGI callback function to query the Charon II switches. | |
Variables | |
static u_char | spi_ni = 255 |
Number of detected opto inputs. | |
static u_char | spi_no = 255 |
Number of detected relays. | |
static u_long | relay_status |
Relays status. | |
static 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 Charon II LEDs. 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. 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.
![]() This function is called by the HTTP module when a browser requests a CGI function, for which this routine has been registered via NutRegisterCgi().
Definition at line 610 of file cgi.c. References CHARON_CONTROL_CGI, HtmlCheckboxRow(), and HtmlLedRow(). Referenced by main(). |
|
CGI callback function to query the Charon II switches. 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().
![]() 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.
Definition at line 689 of file cgi.c. References CHARON_STATUS_CGI, and HtmlLedRow(). Referenced by main(). |
|
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.
![]() This function is called by the HTTP module when a browser requests a CGI function, for which this routine has been registered via NutRegisterCgi().
Definition at line 330 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 every 5 seconds.
![]() This function is called by the HTTP module when a browser requests a CGI function, for which this routine has been registered via NutRegisterCgi().
Definition at line 400 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 140 of file cgi.c. Referenced by CharonLedControl(), 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 195 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 93 of file cgi.c. Referenced by CharonLedControl(), CharonSwitchStatus(), 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 170 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 225 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 285 of file cgi.c. References relay_known, relay_status, and spi_no. Referenced by SpiRelayControl(). |
|
CGI callback function to query a shift register input board. 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().
![]() Creates HTML code to show the status of the optically isolated inputs of an attached input shift register board. The page will be automatically refreshed every 5 seconds.
Definition at line 547 of file cgi.c. References HtmlLedRow(), OPTO_STATUS_CGI, spi_ni, and spi_no. Referenced by main(). |
|
CGI callback function to control a shift register output board. 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. 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.
![]() This function is called by the HTTP module when a browser requests a CGI function, for which this routine has been registered via NutRegisterCgi().
Definition at line 470 of file cgi.c. References HtmlCheckboxRow(), HtmlLedRow(), ProcessCgiRelayRequest(), RELAY_CONTROL_CGI, relay_known, relay_status, spi_ni, and spi_no. Referenced by main(). |