Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Also note that additional configuration values have to be added to your app_cfg.h file. Refer to See µC/HTTPs Configuration. for more information).

  1. Initialize the static file system.
  2. Add files to the static file system.

Transferring Files to Use with µC/HTTPs

Transferring files on the file system for use with the µC/HTTPs module is outside the scope of this document. For this purpose, you could use a FTP server or client, such as µC/FTPs or µC/FTPc, or again use a mass storage media to into your file system.

...

The µC/HTTPs module has to be configured according to your specific needs. A template configuration file ( http-s_cfg.h ) is included in the module package (see See Directories and Files.), and this configuration should be copied into your app_cfg.h file. Here is the list of the values and description of each of the configuration variable. However, keep in mind that future releases of this module might include more configuration options.

Module Configuration

#define HTTPs_CFG_IPPORT 80

This value defines the TCP port µC/HTTPs will listen for requests. The default value is 80.

#define HTTPs_CFG_MAX_ACCEPT_TIMEOUT_MS 5000
#define HTTPs_CFG_MAX_RX_TIMEOUT_MS 5000
#define HTTPs_CFG_MAX_TX_TIMEOUT_MS 5000

These values define the timeout values for sockets, in milliseconds. If the server doesn’t reply within the specified time after a request is made, that request will be aborted.

#define HTTPs_CFG_MAX_ACCEPT_RETRY 1
#define HTTPs_CFG_MAX_RX_RETRY 3
#define HTTPs_CFG_MAX_TX_RETRY 3

These values define the maximum number of retries for various actions before returning an error to the application.

...

#define HTTPs_CFG_FILE_RD_BUF_LEN 1024
#define HTTPs_CFG_FILE_TX_BUF_LEN 1460

These values determine the size of the buffer used to read the HTML file and the size of the one used to transmit this file, in bytes. If you choose to increase these values, make sure the HTTPs task’s size is large enough. If you enable the parsing of the tokens found in HTML files, you have to make sure the read buffer length ( HTTPs_CFG_FILE_RD_BUF_LEN ) is at least as large as the longest token present in your HTML files.

...

#define HTTPs_CFG_TOK_PARSE_EN DEF_ENABLED
#define HTTPs_CFG_TOK_PARSE_TBL_SIZE 256

HTTPs_CFG_TOK_PARSE_EN allows the developer to enable or disable the parsing of the tokens found in HTML files (dynamic content). If the server does not host such content, set this configuration variable to DEF_DISABLED in order to speed up processing. The other variable defines the size of the array used to collect the tokens’ values when parsing the file. Make sure it is large enough to contain all of these values. The minimum for this value is 2.

#define HTTPs_CFG_FS_ROOT "/HTTPRoot

This defines the file system root for the µC/HTTPs module.

#define HTTPs_CFG_DFLT_FILE "index.htm"

This value defines the default file returned to web browser when no file is specified.

...

#define HTTPs_CFG_ERR_MSG_HTML_NOT_FOUND "<HTML>\r\n" \
"<BODY>\r\n" \
"<HEAD><TITLE>SYSTEM ERROR" \
"</TITLE></HEAD>\r\n" \
"<H1>NOT FOUND</H1>\r\n" \
"The requested object does"\
"not exist on this server.\r\n"\
"</BODY>\r\n" \
"</HTML>\r\n"

This value defines the message returned by µC/HTTPs to a web browser when a requested file is not found.

Static File System Module Configuration

...