Cypress middleware APIs return results of type cy_rslt_t and consist of three parts:
Module base Type Library-specific error code +--------------------------------------+------+------------------------------+ |CY_RSLT_MODULE_COMMAND_CONSOLE_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 GitHub connectivity-utilities. For example, the Command Console library uses CY_RSLT_MODULE_COMMAND_CONSOLE_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 are 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_COMMAND_CONSOLE_ERR_BASE CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CY_RSLT_MODULE_COMMAND_CONSOLE_BASE, 0) |
Generic command console base error code. | |
#define | CY_RSLT_COMMAND_CONSOLE_FAILURE ((cy_rslt_t)(CY_RSLT_COMMAND_CONSOLE_ERR_BASE + 1)) |
Generic failure. | |