Class Battery

Class Documentation

class Battery

Battery level module.

Currently hard codes the battery status. It might be useful to provide some configurable parameters for this module in the future.

Public Types

enum Source

Values:

enumerator None
enumerator Adapter
enumerator Dock
enum Level

Values:

enumerator Dangerous
enumerator Low
enumerator Healthy
enumerator Maximum
enum State

Values:

enumerator Discharging
enumerator Charged
enumerator Charging

Public Functions

inline Battery()

Default constructor.

Battery(const uint8_t &new_voltage, const uint8_t &charger_flag)
Level level() const
float percent() const

Public Members

double voltage
State charging_state
Source charging_source

Public Static Attributes

static double capacity
static double low
static double dangerous