Check battery charging status
This snippet will let you check if the device battery is charging.
123456789101112131415#include <device/battery.h>#include <dlog.h> //for logging purposesbool battery_charging = false;if (device_battery_is_charging(&battery_charging) == DEVICE_ERROR_NONE){if (battery_charging == true){LOGI("Battery is charging");}else{LOGI("Battery is not charging");}}