Eddy DK Programmer Guide
123
Chapter 8.
Handling HTML & CGI
This chapter describes the CGI module for the environment configuration used by HTML files and HTML codes.
Provided CGI source and HTML documents are used as Eddy’s default firmware, and it is modifiable as needed.
8.1
WEB Configuration
HTML sources for Eddy are located on src/Eddy_APPs/web/htdocs.
CGI sources containing information for HTML is located on src/Eddy_APPs/web/cgi.
getagent.c
It reads environment configuration file of /etc folder and transfers configuration value to the HTML page to show the
information on the web browser.
setagent.c
It reads configuration value modified by a user on the HTML page and saves the value to a temporary environment
configuration file on /etc.
8.2
Example of HTML Code
The following example shows a part of main.html source.
Coding is executed with values handed over from the CGI and linked symbols, due to the coding cannot be done on
a HTML using variables like on the C language.
Shown in red below are symbol link which transfers value from getagent.c.
(network.html 소스 요약)
<tr bgcolor="#FFFFFF">
<td class="content">IP Address</td>
<td class="content"><input type="text" size="16" maxlength="16" name
="N_IP
" value="[v
,n_ip
]" >
<tr bgcolor="#FFFFFF">
<td class="content">Subnet Mask</td>
<td class="content"><input type="text" size="16" maxlength="16" name="
N_MASK
" value="[v,
n_mask
]" >
<tr bgcolor="#FFFFFF">
<td class="content">Gateway</td>
<td class="content"><input type="text" size="16" maxlength="16" name="
N_GW
" value="[v,
n_gw
]" >
<tr bgcolor="#FFFFFF">
<td class="content">DNS</td>