Secure Sockets
Secure Sockets results/error codes

General Description

Secure Sockets Library APIs return results of type cy_rslt_t and consist of three parts:

Result Format
           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.

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.

Macros

#define CY_RSLT_SECURE_SOCKETS_ERR_BASE   CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CY_RSLT_MODULE_SECURE_SOCKETS_BASE, 0)
 Secure Sockets error code base.
 
#define CY_RSLT_MODULE_SECURE_SOCKETS_TCPIP_ERROR   ( CY_RSLT_SECURE_SOCKETS_ERR_BASE + 1 )
 Generic TCP/IP error.
 
#define CY_RSLT_MODULE_SECURE_SOCKETS_BADARG   ( CY_RSLT_SECURE_SOCKETS_ERR_BASE + 2 )
 Invalid argument.
 
#define CY_RSLT_MODULE_SECURE_SOCKETS_NOMEM   ( CY_RSLT_SECURE_SOCKETS_ERR_BASE + 3 )
 Out of resources. More...
 
#define CY_RSLT_MODULE_SECURE_SOCKETS_NOT_CONNECTED   ( CY_RSLT_SECURE_SOCKETS_ERR_BASE + 4 )
 Socket not connected.
 
#define CY_RSLT_MODULE_SECURE_SOCKETS_CLOSED   ( CY_RSLT_SECURE_SOCKETS_ERR_BASE + 5 )
 Socket closed.
 
#define CY_RSLT_MODULE_SECURE_SOCKETS_ALREADY_CONNECTED   ( CY_RSLT_SECURE_SOCKETS_ERR_BASE + 6 )
 Socket already connected.
 
#define CY_RSLT_MODULE_SECURE_SOCKETS_PROTOCOL_NOT_SUPPORTED   ( CY_RSLT_SECURE_SOCKETS_ERR_BASE + 7 )
 Protocol not supported.
 
#define CY_RSLT_MODULE_SECURE_SOCKETS_OPTION_NOT_SUPPORTED   ( CY_RSLT_SECURE_SOCKETS_ERR_BASE + 8 )
 Socket option not supported error. More...
 
#define CY_RSLT_MODULE_SECURE_SOCKETS_INVALID_OPTION   ( CY_RSLT_SECURE_SOCKETS_ERR_BASE + 9 )
 Invalid option.
 
#define CY_RSLT_MODULE_SECURE_SOCKETS_NOT_LISTENING   ( CY_RSLT_SECURE_SOCKETS_ERR_BASE + 10 )
 Socket not listening.
 
#define CY_RSLT_MODULE_SECURE_SOCKETS_TIMEOUT   ( CY_RSLT_SECURE_SOCKETS_ERR_BASE + 11 )
 Operation timed out.
 
#define CY_RSLT_MODULE_SECURE_SOCKETS_IN_PROGRESS   ( CY_RSLT_SECURE_SOCKETS_ERR_BASE + 12 )
 Operation in progress.
 
#define CY_RSLT_MODULE_SECURE_SOCKETS_HOST_NOT_FOUND   ( CY_RSLT_SECURE_SOCKETS_ERR_BASE + 13 )
 Host not found.
 
#define CY_RSLT_MODULE_SECURE_SOCKETS_TLS_ERROR   ( CY_RSLT_SECURE_SOCKETS_ERR_BASE + 14 )
 Generic TLS error.
 
#define CY_RSLT_MODULE_SECURE_SOCKETS_INVALID_SOCKET   ( CY_RSLT_SECURE_SOCKETS_ERR_BASE + 15 )
 Invalid socket.
 
#define CY_RSLT_MODULE_SECURE_SOCKETS_NOT_SUPPORTED   ( CY_RSLT_SECURE_SOCKETS_ERR_BASE + 16 )
 API not supported.
 
#define CY_RSLT_MODULE_SECURE_SOCKETS_NOT_INITIALIZED   ( CY_RSLT_SECURE_SOCKETS_ERR_BASE + 17 )
 Library not initialized.
 
#define CY_RSLT_MODULE_SECURE_SOCKETS_NETIF_DOES_NOT_EXIST   ( CY_RSLT_SECURE_SOCKETS_ERR_BASE + 18 )
 Network interface does not exist.
 
#define CY_RSLT_MODULE_SECURE_SOCKETS_ARP_TIMEOUT   ( CY_RSLT_SECURE_SOCKETS_ERR_BASE + 19 )
 ARP resolution timed out.
 
#define CY_RSLT_MODULE_SECURE_SOCKETS_BAD_NW_STACK_CONFIGURATION   ( CY_RSLT_SECURE_SOCKETS_ERR_BASE + 20 )
 Both IPv4 and IPv6 network stack configuration are disabled.
 
#define CY_RSLT_MODULE_SECURE_SOCKETS_ADDRESS_IN_USE   ( CY_RSLT_SECURE_SOCKETS_ERR_BASE + 21 )
 Socket address already in use.
 
#define CY_RSLT_MODULE_SECURE_SOCKETS_MAX_MEMBERSHIP_ERROR   ( CY_RSLT_SECURE_SOCKETS_ERR_BASE + 22 )
 Maximum number of multicast addresses are already created.
 
#define CY_RSLT_MODULE_SECURE_SOCKETS_MULTICAST_ADDRESS_NOT_REGISTERED   ( CY_RSLT_SECURE_SOCKETS_ERR_BASE + 23 )
 Multicast address not registered.
 
#define CY_RSLT_MODULE_SECURE_SOCKETS_ERROR_ROUTING   ( CY_RSLT_SECURE_SOCKETS_ERR_BASE + 24 )
 Routing problem.
 
#define CY_RSLT_MODULE_SECURE_SOCKETS_PKCS_ERROR   ( CY_RSLT_SECURE_SOCKETS_ERR_BASE + 25 )
 PKCS generic error.
 
#define CY_RSLT_MODULE_SECURE_SOCKETS_WOULDBLOCK   ( CY_RSLT_SECURE_SOCKETS_ERR_BASE + 26 )
 Send buffer is full while sending / Receive buffer is empty while reading.
 

Macro Definition Documentation

◆ CY_RSLT_MODULE_SECURE_SOCKETS_NOMEM

#define CY_RSLT_MODULE_SECURE_SOCKETS_NOMEM   ( CY_RSLT_SECURE_SOCKETS_ERR_BASE + 3 )

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_OPTION_NOT_SUPPORTED

#define CY_RSLT_MODULE_SECURE_SOCKETS_OPTION_NOT_SUPPORTED   ( CY_RSLT_SECURE_SOCKETS_ERR_BASE + 8 )

Socket option not supported error.

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