Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of nRF51822 by
sdk_errors.h
00001 /* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved. 00002 * 00003 * The information contained herein is property of Nordic Semiconductor ASA. 00004 * Terms and conditions of usage are described in detail in NORDIC 00005 * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. 00006 * 00007 * Licensees are granted free, non-transferable use of the information. NO 00008 * WARRANTY of ANY KIND is provided. This heading must NOT be removed from 00009 * the file. 00010 * 00011 */ 00012 00013 /**@file 00014 * 00015 * @defgroup sdk_error SDK Error codes 00016 * @{ 00017 * @ingroup app_common 00018 * @{ 00019 * @details Error codes are 32-bit unsigned integers with the most significant 16-bit reserved for 00020 * identifying the module where the error occurred while the least least significant LSB 00021 * are used to provide the cause or nature of error. Each module is assigned a 16-bit 00022 * unsigned integer. Which it will use to identify all errors that occurred in it. 16-bit 00023 * LSB range is with module id as the MSB in the 32-bit error code is reserved for the 00024 * module. As an example, if 0x8800 identifies a certain SDK module, all values from 00025 * 0x88000000 - 0x8800FFFF are reserved for this module. 00026 * It should be noted that common error reasons have been assigned values to make it 00027 * possible to decode error reason easily. As an example, lets module uninitialized has 00028 * been assigned an error code 0x000A0. Then, if application encounters an error code 00029 * 0xZZZZ00A0, it knows that it accessing a certain module without initializing it. 00030 * Apart from this, each module is allowed to define error codes that are not covered by 00031 * the common ones, however, these values are defined in a range that does not conflict 00032 * with common error values. For module, specific error however, it is possible that the 00033 * same error value is used by two different modules to indicated errors of very different 00034 * nature. If error is already defined by the NRF common error codes, these are reused. 00035 * A range is reserved for application as well, it can use this range for defining 00036 * application specific errors. 00037 * 00038 * @note Success code, NRF_SUCCESS, does not include any module identifier. 00039 00040 */ 00041 00042 #ifndef SDK_ERRORS_H__ 00043 #define SDK_ERRORS_H__ 00044 00045 #include "nrf_error.h" 00046 00047 /** 00048 * @defgroup sdk_err_base Base defined for SDK Modules 00049 * @{ 00050 */ 00051 #define SDK_ERROR_BASE (NRF_ERROR_BASE_NUM + 0x8000) /**< Base value defined for SDK module identifiers. */ 00052 #define SDK_COMMON_ERROR_BASE (NRF_ERROR_BASE_NUM + 0x0080) /**< Base error value to be used for SDK error values. */ 00053 /* @} */ 00054 00055 /** 00056 * @defgroup sdk_module_codes Codes reserved as identification for module where the error occurred. 00057 * @{ 00058 */ 00059 #define DEVICE_MANAGER_ERR_BASE (0x8000) 00060 /* @} */ 00061 00062 /** 00063 * @defgroup sdk_common_errors Codes reserved as identification for common errors. 00064 * @{ 00065 */ 00066 #define MODULE_NOT_INITIALZED (SDK_COMMON_ERROR_BASE+0x0000) 00067 #define MUTEX_INIT_FAILED (SDK_COMMON_ERROR_BASE+0x0001) 00068 #define MUTEX_LOCK_FAILED (SDK_COMMON_ERROR_BASE+0x0002) 00069 #define MUTEX_UNLOCK_FAILED (SDK_COMMON_ERROR_BASE+0x0003) 00070 #define MUTEX_COND_INIT_FAILED (SDK_COMMON_ERROR_BASE+0x0004) 00071 #define API_NOT_IMPLEMENTED (SDK_COMMON_ERROR_BASE+0x0010) 00072 #define FEATURE_NOT_ENABLED (SDK_COMMON_ERROR_BASE+0x0011) 00073 /* @} */ 00074 00075 00076 /** 00077 * @defgroup dm_specific_errors Error / status codes specific to device manager. 00078 * @{ 00079 */ 00080 #define DM_NO_APP_CONTEXT (DEVICE_MANAGER_ERR_BASE+0x0040) 00081 #define DM_SERVICE_CONTEXT_NOT_APPLIED (DEVICE_MANAGER_ERR_BASE+0x0041) 00082 #define DM_CONTEXT_INFO_LOST (DEVICE_MANAGER_ERR_BASE+0x0042) 00083 #define DM_DEVICE_CONTEXT_FULL (DEVICE_MANAGER_ERR_BASE+0x0043) 00084 /* @} */ 00085 00086 /** 00087 * @brief API Result. 00088 * 00089 * @details Indicates success or failure of an API procedure. In case of failure, a comprehensive 00090 * error code indicating cause or reason for failure is provided. 00091 * 00092 * Though called an API result, it could used in Asynchronous notifications callback along 00093 * with asynchronous callback as event result. This mechanism is employed when an event 00094 * marks the end of procedure initiated using API. API result, in this case, will only be 00095 * an indicative of whether the procedure has been requested successfully. 00096 */ 00097 typedef uint32_t api_result_t; 00098 /** @} */ 00099 /** @} */ 00100 00101 #endif // SDK_ERRORS_H__ 00102
Generated on Tue Jul 12 2022 16:21:04 by
