...
µC/HTTPs allows dynamic content to be inserted in HTML web pages (files having the htm or html suffix) by using special tokens being substituted before the page is actually sent to the web browser. Those tokens are represented in the HTML files as:
${TOKEN_NAME}
Assuming we have an HTML page that look like this:
...
...
When a web client requests this file, µC/HTTPs will parse the file, find the ${My_IP_Address}
token, and pass the string " My_IP_Address
" into the HTTPs_ValRx()
callback function. That function will then substitute the token for its value, sending the following HTML file to the client:
...
...
See See µC/HTTPs API. for more information on the callback function having to be implemented to support this.
...
Some sections of the source code have been removed or modified to help focus on the µC/HTTPs module use.
Example Code
static void AppTaskStart (void *p_arg)
{
...
AppInit_TCPIP(); (1)
AppInit_FS(); (2)
success = HTTPs_Init(); (3)
if (success == DEF_OK) {
APP_TRACE((CPU_CHAR *)"HTTP server successfully initialized\n\r");
} else {
APP_TRACE((CPU_CHAR *)"HTTP server initialization failed\n\r");
}
while (DEF_YES) {
OSTimeDlyHMSM(0, 0, 0, 100);
}
}
...