HTTPs_Init

Initializes HTTP server suite:

  • Validate error file length.
  • Initialize global variables for the instances’ list.

Files

http-s.h/http-s.c

Prototype

void  HTTPs_Init (MEM_SEG    *p_mem_seg,
                  HTTPs_ERR  *p_err);

Arguments

p_mem_seg

Pointer to the memory segment to use to allocate necessary objects.
Set to DEF_NULL to allocate objects on the HEAP configured in uC/LIB.

p_err

Pointer to variable that will receive the return error code.

Returned Values

None.

Required Configuration

None.

Notes / Warnings

  • Must be called after the µC/TCP-IP stack has been initialize and is up running.

Example Usage

          static  void  AppTaskStart (void  *p_arg) 
          { 
              HTTPs_INSTANCE  *p_instance;
              HTTPs_ERR        https_err;
           
           
              AppInit_TCPIP(); 
              App_Init_FS();
           
              HTTPs_Init(DEF_NULL, &http_err);
              if (https_err == HTTPs_ERR_NONE) {
                  p_instance = HTTPs_InstanceInit(&HTTPs_CfgInstance_0, &HTTPs_TaskCfgInstance_0, &https_err);
                  if (https_err == HTTPs_ERR_NONE) {
                      HTTPs_InstanceStart(p_instance, &https_err);
                      if (https_err == HTTPs_ERR_NONE) {
                          printf("HTTP server instance #0 successfully started.\n\r");
                      } else {
                          printf("HTTP server instance #0 start failed.\n\r");
                      }
                  }
              }
               
              while (DEF_YES) { 
                  OSTimeDlyHMSM(0, 0, 0, 100); 
              } 
          }