Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

  1. This example show how to initialize µC/DHCPc:
    1. Initialize uC/HTTPs module objects.
    2. Initialize a web server's instance
    3. Start the web server's instance.
       
  2. This example assumes the presence of µC/TCP-IP and that all prerequisite modules have been initialized before starting to initialize µC/HTTPs and any web server instance.

 

 

  1. Prerequisite modules must be initialized before calling any uC/HTTPs functions.

  2. Obviously before starting or trying to reach web server. The files must loaded in the file system to be able to get it using an HTTP client.

  3. Prior to do any call to uC/HTTPs, the module must be initialized. This is done by calling HTTPs_Init(). If the process is successful, the Web server internal data structures are initialized.

  4. Each web server must be initialized before it can be started or stopped. HTTPs_InstanceInit() is responsible to allocate memory for the instance, initialize internal data structure and create the web server instance's task..

    1. The first argument is the instance configuration, which should be modified following you requirements. The intance's configuration set the server's port, the number of connection that can be accepted, the hooks functions, etc.

    2. The second argument is the pointer to the File system port API. uC/HTTPs is using the API defined by the uC/TCP-IP Network file system abstraction layer to access the File system. The API structure can be found in:

      1. The uC/TCP-IP Network file system abstraction layer folder for traditional file system;

        '$uC-TCPIP/FS/<fs>/net_<fs>.h'
        NetFS_API_FS_V4
         

      2. The static file system API is located under uC/HTTPs File system folder;

        '$uc-HTTPs/FS/Static/http-s_fs_static.h'
        HTTPs_FS_API_Static
         

  5. Once a web server instance is initialized, it can be started using HTTPs_InstanceStart() to become come accessible. This function start the web server instance's task. Each instance has is own task and all accepted connection is processed with this single task.

 

 

  • No labels