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

◆ lwm2m_carrier_battery_level_set()

int lwm2m_carrier_battery_level_set ( uint8_t battery_level)

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

Set the OMA LwM2M Device object Battery Level resource (/3/0/9).

LWM2M_CARRIER_POWER_SOURCE_INTERNAL_BATTERY needs to be enabled first using lwm2m_carrier_avail_power_sources_set().

  • The default value of this resource is 0 (%).
Parameters
[in]battery_levelInternal battery level percentage (0-100).
Return values
0If the battery level has been updated successfully.
-EINVALIf the specified battery level lies outside the 0-100% range.
-ENODEVIf internal battery is not listed as an available power source.