Skip to content

MobileDataTypes

BatteryData

The BatteryData data consists of the following member variables:

BatteryData
class BatteryData
{
    int16_t level;
    BatteryState state;
}

The individual variables of the data type are explained below:

Explanation of the member variables
  • level: Integer value indicating the current battery level in range [0, 100]
  • state: An enum variable indicating the current battery state such as unknown, charging, full, etc. (see BatteryState)

BatteryState

The BatteryState is an enum that indicates the current charging state of the battery. It is defined as follows:

BatteryData
enum BatteryState
{
    UNKNOWN             = 0,
    UNPLUGGED           = 1,
    FULL                = 2,
    CHARGING            = 3,
    USB_CHARGING        = 4,
    AC_CHARGING         = 5,
    WIRELESS_CHARGING   = 6,
};