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).

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

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

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.

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

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.

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.

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

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

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

If the static file system is being used with µC/HTTPs, the following configuration values also have to be added to your app_cfg.h file.

This value defines the maximum number of files the static file system could manage.

This value defines the maximum number of directory the static file system could manage.

This value defines the maximum file name length.

Operating System Configuration

...

The priority of µC/HTTPs task is dependent on the requirements of the application.For µC/OS-II and µC/OS-III, the following macros must be configured within app_cfg.h :

Value of the priority for the µC/HTTPs tasks. The value assigned depend of the software architecture of your system, and of the importance of this module response time relative to the other tasks

Value of the priority for the µC/HTTPs tasks. This default value should be enough for most environments, but you should check this on your system for reliability or performance purpose.

Interface with RTOS

µC/HTTPs requires the presence of a Real Time Operating System (RTOS). As mentioned in See Directories and Files., the sample application uses µC/OS-II or µC/OS-III. It is possible to port µC/HTTPs so it is used with other OS by providing an appropriate implementation of http-s_os.c .

...

Some sections of the source code have been removed or modified to help focus on the µC/HTTPs module use.