Versions Compared

Key

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

...

This section describes all the steps required to build a HTTPsHTTP-server based application. The instructions provided in this section are not intended for any particular toolchain, but instead are described in a generic way that can be adapted to any toolchain.

The best way to start building a  HTTPs HTTP-server based project is to start from an existing µC/TCP-IP project. 

...

The first step before including the µC/HTTPs HTTP-server is to have a working project with the µC/TCP-IP. As previously mentioned, Micriµm may offer starting example with µC/OS-III kernels and µC/TCP-IP and even with µC/HTTPs HTTP-server for many evalboards. 

If no project that include µC/TCP-IP is available, you should follow the µC/TCP-IP Getting Started Guide to ensure to have a working project which use fix IP address before installing µC/HTTPsHTTP-server. Then you can follow the following steps to build and run a first µC/HTTPs HTTP-server sample application.

Including Additional Modules to the Project

Once you have a working project with your RTOS and µC/TCP-IP additional modules are needed by the Micriµm HTTP server that are not necessarily already included in your project. Therefore, be sure to add µC/CPU, µC/LIB, µC/Commmon and µC/TCP-IP to your project.  

Refer to the following manuals for further information about MIcrium modules:.

µC/TCP-IP Documentation

µC/OS-II Documentation

µC/OS-III Documentation

libdocµC/LIB Documentation

µC/CPU Documentation

µC/Common Module

Including µC/

...

HTTP-server Source Code

Include the following files in your project tree from the µC/HTTPs HTTP-server source code distribution, as indicated in Figure - µC/HTTPs Source Code- HTTP-server Directory Tree.

As indicated in the Figure - µC/HTTPs Source Code- HTTP-server Directory Tree, all the files in the Source folder uC-HTTP/Server/Source path must be added to your project tree. Furthermore, http-s_os.c file of the selected RTOS must be added as well as the generic http-s_os.h file that can be found in the OS folder. as all the files in the uC-HTTP/Common folder.

For the file system, µC/HTTPs HTTP-server uses the network file system layer included with µC/TCP-IP located inside the uC-TCPIP/FS folder. Therefore, the header file net_fs.h inside this folder must be include to your project, no matter what file system your HTTP server is using.

...

If the Static file system is used, the port for this file system is located inside uC/HTTPsHTTP-server. Therefore, the source files under the folder name Static must be include to your project. Furthermore, The static file system configuration file  must be copied in your application directory. This configuration file can be retrieve inside the folder Cfg (i.e Micrium/Software/uC-HTTPsHTTP/Server/FS/Static/Cfg/Template).

...

Finally, add the following include paths to your project’s C compiler settings:

\Micrium\Software\uC-HTTPsHTTP
\Micrium\Software\uC-TCPIP
\Micrium\Software\uC-<OS-Version>

...

Copy the files from the uC-HTTP-HTTPs server configuration folder into your application as illustrated in Figure - HTTP-server Copying Template Files.

Panel
titleHTTP-server Copying Template Files

Image Added

 

http-s_cfg.h is a configuration file used to setup µC/HTTPs HTTP-server module static parameters  and and features such as CGI form configuration, dynamic token replacement  configurationconfiguration, header field feature, proxy configuration and so on. Refer to section Module Configuration for more details on all the configurations inside http-s_cfg.h 

The http-s_instance_cfg.c/.h pair of files, defines the configuration structure for an HTTP server’s instance (see µC/HTTPs Instance Configuration for more details). If your application requires a secured HTTP server instance, the http-s_instance_secure_cfg.c/.h pair of files should be used as template instead.  The secure template is available in the Examples folder.

Modifying the HEAP memory configuration

The µC/HTTPs HTTP-server Module uses additional heap memory space. Therefore, it is possible that your sample application will require more allocation of heap memory. If ti is the case, you can increase the HEAP memory size of your sample project, refer to section µC/LIB Memory Management Configuration for more details on the heap usage. 

Adding µC/

...

HTTP-server application function

Before running the sample application, you will need to add the new function call, in your application file to initialize and setup the µC/HTTPs HTTP-server module. Section Sample Application gives an example of how to initialize µC/HTTPs HTTP-server and start a web server instance. 

...

Adding Additional includes

#include <Source<Server/Source/http-s.h>
#include  <FS/uC-FS-V4/net_fs_v4.h> (optional if uC/FS is used)
#include  <FS <Server/FS/Static/http-s_fs_static.h> (optional if no File system is available in the project)