Macros

group http_server_defines

HTTP server preprocessor directives such as results and error codes.

Middleware APIs return results of type cy_rslt_t and are composed of three parts:

  • module base

  • type

  • error code

           Module base         Type    Library specific error code
   +---------------------------+------+------------------------------+
   |CY_RSLT_MODULE_HTTP_SERVER | 0x2  |           Error Code         |
   +---------------------------+------+------------------------------+
             14-bits            2-bits            16-bits

See the macro section of this document for library-specific error codes.
Result Format

The cy_rslt_t data structure is a part of cy_result.h in Mbed OS PSoC 6 MCU target platform, located in <mbed-os/targets/TARGET_Cypress/TARGET_PSOC6/psoc6csp/core_lib/include>

Module base: This base is derived from CY_RSLT_MODULE_MIDDLEWARE_BASE (defined in cy_result.h) and is an offset of the CY_RSLT_MODULE_MIDDLEWARE_BASE. The details of the offset and the middleware base are defined in cy_result_mw.h, which is part of Github connectivity-utilities For example, the HTTP server uses CY_RSLT_MODULE_HTTP_SERVER as the module base.

Type: This type is defined in cy_result.h and can be one of CY_RSLT_TYPE_FATAL, CY_RSLT_TYPE_ERROR, CY_RSLT_TYPE_WARNING or CY_RSLT_TYPE_INFO. AWS library error codes are of type CY_RSLT_TYPE_ERROR.

Library-specific error code: These error codes are library-specific and defined in the macro section.

Helper macros used for creating library-specific results are provided as part of cy_result.h.

Defines

CY_RSLT_MODULE_HTTP_SERVER_ERR_CODE_START

Results returned by HTTP Server Library.

CY_RSLT_HTTP_SERVER_ERR_BASE

HTTP server error code base.

CY_RSLT_HTTP_SERVER_ERROR_NO_MEMORY

Out of memory.

CY_RSLT_HTTP_SERVER_ERROR_THREAD_INIT

Error initializing thread.

CY_RSLT_HTTP_SERVER_ERROR_QUEUE_INIT

Error initializing queue.

CY_RSLT_HTTP_SERVER_ERROR_MUTEX_INIT

Error initializing mutex.

CY_RSLT_HTTP_SERVER_ERROR_TCP_SERVER_START

Failed to start TCP server.

CY_RSLT_HTTP_SERVER_ERROR_UNSUPPORTED

Feature not supported.

CY_RSLT_HTTP_SERVER_ERROR_BADARG

Bad argument/parameter.

CY_RSLT_HTTP_SERVER_ERROR_NOT_FOUND

Resource not found.

CY_RSLT_HTTP_SERVER_ERROR_PARTIAL_RESULTS

Partially processed.

Returned by application’s receive callback

CY_RSLT_HTTP_SERVER_PAGE_DATABASE_FULL

Exceeded maximum number of resources.

CY_RSLT_ERROR

HTTP server generic error.

MAX_NUMBER_OF_HTTP_SERVER_RESOURCES

Max number of resources supported by the HTTP server.

note

Change this macro to support more resources.