This class implements battery functions.
More...
#include <Battery.h>
|
| static float | currentCapacity (const char *path=nullptr) |
| | Returns the current battery capacity status in percent.
|
| |
| static float | currentTemperature () |
| | Returns the current battery temperature in Celsius.
|
| |
| static bool | currentCurrent (double ¤t) |
| | Returns the current battery current in amps.
|
| |
| static bool | currentVoltage (double &voltage) |
| | Returns the current battery voltage in volts.
|
| |
| static bool | isCharging (bool &state) |
| | Returns whether the battery is charging.
|
| |
This class implements battery functions.
◆ ScopedFILE
Definition of a scoped object for FILE pointers.
◆ currentCapacity()
| static float Ocean::Platform::Android::Battery::currentCapacity |
( |
const char * |
path = nullptr | ) |
|
|
static |
Returns the current battery capacity status in percent.
- Parameters
-
| path | Optional path to the battery file, if not specified the default path will be used |
- Returns
- Current battery capacity status, -1 if invalid
◆ currentCurrent()
| static bool Ocean::Platform::Android::Battery::currentCurrent |
( |
double & |
current | ) |
|
|
static |
Returns the current battery current in amps.
- Parameters
-
| current | The resulting single current reading for the battery, in amps |
- Returns
- True, if succeeded
◆ currentTemperature()
| static float Ocean::Platform::Android::Battery::currentTemperature |
( |
| ) |
|
|
static |
Returns the current battery temperature in Celsius.
- Returns
- Current battery temperature, -1 if invalid
◆ currentVoltage()
| static bool Ocean::Platform::Android::Battery::currentVoltage |
( |
double & |
voltage | ) |
|
|
static |
Returns the current battery voltage in volts.
- Parameters
-
| voltage | The resulting single voltage reading for the battery, in volts |
- Returns
- True, if succeeded
◆ isCharging()
| static bool Ocean::Platform::Android::Battery::isCharging |
( |
bool & |
state | ) |
|
|
static |
Returns whether the battery is charging.
- Returns
- state The resulting state whether the battery is charging
-
True, if succeeded
The documentation for this class was generated from the following file: