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

◆ lwm2m_carrier_avail_power_sources_set()

int lwm2m_carrier_avail_power_sources_set ( const uint8_t * power_sources,
uint8_t power_source_count )

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

Set the OMA LwM2M Device object Available Power Sources resource (/3/0/6).

It is necessary to call this function before any other device power source related functions listed in this file, as any updates of voltage/current measurements performed on power sources that have not been reported will be discarded. Upon consecutive calls of this function, the corresponding current and voltage measurements will be reset to 0. Similarly, the battery status will be set to UNKNOWN and the battery level to 0%.

Parameters
[in]power_sourcesArray of available lwm2m_carrier_power_source_values.
[in]power_source_countNumber of power sources currently used by the device.
Return values
0If the available power sources have been set successfully.
-E2BIGIf the reported number of power sources is bigger than the maximum supported.
-EINVALIf one or more of the power sources are not supported.
-ENOENTIf LwM2M object is not initialized yet.