Macros

group http_client_defines

HTTP Client library preprocessor directives such as results and error codes.

Cypress middleware APIs return results of type cy_rslt_t and consist of three parts:

  • module base

  • type

  • error code

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

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

The data structure cy_rslt_t is part of cy_result.h. In AnyCloud, the PSoC 6 MCU target platform is located in <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 CY_RSLT_MODULE_MIDDLEWARE_BASE. 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 Client uses CY_RSLT_MODULE_HTTP_CLIENT as the module base, which is 0x020E.

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. HTTP Client library error codes are of type CY_RSLT_TYPE_ERROR, which is 0x2.

Library-specific error codes: 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_CLIENT_ERR_CODE_START

HTTP Client library error code start.

CY_RSLT_HTTP_CLIENT_ERR_BASE

HTTP Client library error base.

CY_RSLT_HTTP_CLIENT_ERROR

Generic HTTP Client library error.

CY_RSLT_HTTP_CLIENT_ERROR_BADARG

Invalid argument.

CY_RSLT_HTTP_CLIENT_ERROR_NOMEM

Out of memory.

CY_RSLT_HTTP_CLIENT_ERROR_INIT_FAIL

HTTP Client library Init failed.

CY_RSLT_HTTP_CLIENT_ERROR_DEINIT_FAIL

HTTP Client library Deinit failed.

CY_RSLT_HTTP_CLIENT_ERROR_OBJ_NOT_INITIALIZED

HTTP Client object not initialized.

CY_RSLT_HTTP_CLIENT_ERROR_CONNECT_FAIL

HTTP connect failed.

CY_RSLT_HTTP_CLIENT_ERROR_DISCONNECT_FAIL

HTTP disconnect failed.

CY_RSLT_HTTP_CLIENT_ERROR_NOT_CONNECTED

HTTP Client not connected.

CY_RSLT_HTTP_CLIENT_ERROR_ALREADY_CONNECTED

HTTP Client already connected.

CY_RSLT_HTTP_CLIENT_ERROR_INVALID_CREDENTIALS

Invalid credentials.

CY_RSLT_HTTP_CLIENT_ERROR_HANDSHAKE_FAIL

TLS handshake failed.

CY_RSLT_HTTP_CLIENT_ERROR_PARTIAL_RESPONSE

HTTP response was partially received.

CY_RSLT_HTTP_CLIENT_ERROR_NO_RESPONSE

No HTTP response was received.

CY_RSLT_HTTP_CLIENT_ERROR_MAX_HEADER_SIZE_EXCEEDED

Server sent more headers than the configured number of headers.

CY_RSLT_HTTP_CLIENT_ERROR_INVALID_CHUNK_HEADER

Server sent a chunk header containing one or more invalid characters.

CY_RSLT_HTTP_CLIENT_ERROR_INVALID_CONTENT_LENGTH

Response contains invalid characters in the Content-Length header.

CY_RSLT_HTTP_CLIENT_ERROR_PARSER

Error occurred while parsing the response.

CY_RSLT_HTTP_CLIENT_ERROR_NO_HEADER

The requested header field was not found in the response.

CY_RSLT_HTTP_CLIENT_ERROR_INVALID_RESPONSE

HTTP response is either corrupt or incomplete.