nRF51 SDK - S210 SoftDevice
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
SDK Error codes

Modules

 Base defined for SDK Modules
 
 Codes reserved as identification for module where the error occurred.
 
 Codes reserved as identification for common errors.
 
 Error / status codes specific to device manager.
 

Typedefs

typedef uint32_t ret_code_t
 API Result. More...
 

Detailed Description

Error codes are 32-bit unsigned integers with the most significant 16-bit reserved for identifying the module where the error occurred while the least least significant LSB are used to provide the cause or nature of error. Each module is assigned a 16-bit unsigned integer. Which it will use to identify all errors that occurred in it. 16-bit LSB range is with module id as the MSB in the 32-bit error code is reserved for the module. As an example, if 0x8800 identifies a certain SDK module, all values from 0x88000000 - 0x8800FFFF are reserved for this module. It should be noted that common error reasons have been assigned values to make it possible to decode error reason easily. As an example, lets module uninitialized has been assigned an error code 0x000A0. Then, if application encounters an error code 0xZZZZ00A0, it knows that it accessing a certain module without initializing it. Apart from this, each module is allowed to define error codes that are not covered by the common ones, however, these values are defined in a range that does not conflict with common error values. For module, specific error however, it is possible that the same error value is used by two different modules to indicated errors of very different nature. If error is already defined by the NRF common error codes, these are reused. A range is reserved for application as well, it can use this range for defining application specific errors.

Note
Success code, NRF_SUCCESS, does not include any module identifier.

Typedef Documentation

typedef uint32_t ret_code_t

API Result.

Indicates success or failure of an API procedure. In case of failure, a comprehensive error code indicating cause or reason for failure is provided.

Though called an API result, it could used in Asynchronous notifications callback along with asynchronous callback as event result. This mechanism is employed when an event marks the end of procedure initiated using API. API result, in this case, will only be an indicative of whether the procedure has been requested successfully.