nRF Connect SDK API 2.8.99
Loading...
Searching...
No Matches

◆ lwm2m_carrier_error_code_add()

int lwm2m_carrier_error_code_add ( int32_t error)

#include <lib/bin/lwm2m_carrier/include/lwm2m_carrier.h>

Set an error code in the OMA LwM2M Device object Error Code resource (/3/0/11).

At startup the error code is specified as 0, indicating no error. The error code is to be updated whenever a new error occurs. Or after an LWM2M_CARRIER_EVENT_ERROR_CODE_RESET event if the error code is still valid. Multiple error codes can be set, if the reported error is already present, the error code will remain unchanged.

Parameters
[in]errorIndividual error to be added (lwm2m_carrier_error_code_values) LWM2M_CARRIER_ERROR_CODE_NO_ERROR will reset all error codes.
Return values
0If the error code has been added successfully.
-EINVALIf the error code is not supported.
-ENOENTIf LwM2M object is not initialized yet.