Secure Sockets results/error codes

group group_secure_sockets_results

Secure Sockets Library 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
   +-----------------------------------+------+------------------------------+
   |CY_RSLT_MODULE_SECURE_SOCKETS_BASE | 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 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 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 the GitHub connectivity-utilities repo. For example, the Secure Sockets Library uses CY_RSLT_MODULE_SECURE_SOCKETS_BASE 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 the library-specific result are provided as part of cy_result.h.

Defines

CY_RSLT_SECURE_SOCKETS_ERR_BASE

Secure Sockets error code base.

CY_RSLT_MODULE_SECURE_SOCKETS_TCPIP_ERROR

Generic TCP/IP error.

CY_RSLT_MODULE_SECURE_SOCKETS_BADARG

Invalid argument.

CY_RSLT_MODULE_SECURE_SOCKETS_NOMEM

Out of resources.

This error is returned if the system goes out of memory, or network stack resources such as network buffers or the number of connections used exceeds the configured value. To debug this error, check network stack configurations based on the API that is returning this error.

CY_RSLT_MODULE_SECURE_SOCKETS_NOT_CONNECTED

Socket not connected.

CY_RSLT_MODULE_SECURE_SOCKETS_CLOSED

Socket closed.

CY_RSLT_MODULE_SECURE_SOCKETS_ALREADY_CONNECTED

Socket already connected.

CY_RSLT_MODULE_SECURE_SOCKETS_PROTOCOL_NOT_SUPPORTED

Protocol not supported.

CY_RSLT_MODULE_SECURE_SOCKETS_OPTION_NOT_SUPPORTED

Socket option not supported error.

Secure Socket Layer returns this error code if the feature is not enabled in lwipopts.h.

CY_RSLT_MODULE_SECURE_SOCKETS_INVALID_OPTION

Invalid option.

CY_RSLT_MODULE_SECURE_SOCKETS_NOT_LISTENING

Socket not listening.

CY_RSLT_MODULE_SECURE_SOCKETS_TIMEOUT

Operation timed out.

CY_RSLT_MODULE_SECURE_SOCKETS_IN_PROGRESS

Operation in progress.

CY_RSLT_MODULE_SECURE_SOCKETS_HOST_NOT_FOUND

Host not found.

CY_RSLT_MODULE_SECURE_SOCKETS_TLS_ERROR

Generic TLS error.

CY_RSLT_MODULE_SECURE_SOCKETS_INVALID_SOCKET

Invalid socket.

CY_RSLT_MODULE_SECURE_SOCKETS_NOT_SUPPORTED

API not supported.

CY_RSLT_MODULE_SECURE_SOCKETS_NOT_INITIALIZED

Library not initialized.

CY_RSLT_MODULE_SECURE_SOCKETS_NETIF_DOES_NOT_EXIST

Network interface does not exist.

CY_RSLT_MODULE_SECURE_SOCKETS_ARP_TIMEOUT

ARP resolution timed out.

CY_RSLT_MODULE_SECURE_SOCKETS_BAD_NW_STACK_CONFIGURATION

Both IPv4 and IPv6 network stack configuration are disabled.

CY_RSLT_MODULE_SECURE_SOCKETS_ADDRESS_IN_USE

Socket address already in use.

CY_RSLT_MODULE_SECURE_SOCKETS_MAX_MEMBERSHIP_ERROR

Maximum number of multicast addresses are already created.

CY_RSLT_MODULE_SECURE_SOCKETS_MULTICAST_ADDRESS_NOT_REGISTERED

Multicast address not registered.

CY_RSLT_MODULE_SECURE_SOCKETS_ERROR_ROUTING

Routing problem.