![]() |
nRF5 SDK
v14.2.0
|
Choose documentation: | nRF5 SDK | S112 SoftDevice API | S132 SoftDevice API | S140 SoftDevice API | S212 SoftDevice API | S332 SoftDevice API |
This module converts the numeric error code that is returned by nRF5 SDK functions to a string that contains human-readable mnemonic.
This module is intended to be used with the Logger module module, but can be also used in any other application that requires human-readable error codes.
The library contains two functions:
The library does not support generating a special string with the error number for an unknown error, like in the ANSI strerror
function. The reason is maintaining library reentrancy and the possiblity of simultaneous calls from different contexts. Providing such an option would require a global buffer that would be broken by simultaneous function calls. To generate an error description, if a description is found, use the nrf_strerror_find function:
The library requires a sorted list of all errors including their string representations. This list is created manually and the fact that it is properly sorted is tested by unit tests.
For API documentation of this module, refer to Error code to string converter.