Ocean
Ocean::Platform::Android::Battery Class Reference

This class implements battery functions. More...

Static Public Member Functions

static float currentCapacity ()
 Returns the current battery capacity status in percent. More...
 
static float currentTemperature ()
 Returns the current battery temperature in Celsius. More...
 
static bool currentCurrent (double &current)
 Returns the current battery current in amps. More...
 
static bool currentVoltage (double &voltage)
 Returns the current battery voltage in volts. More...
 
static bool isCharging (bool &state)
 Returns whether the battery is charging. More...
 

Protected Types

using ScopedFILE = ScopedObjectCompileTimeT< FILE *, FILE *, int, pclose, 0, false >
 Definition of a scoped object for FILE pointers. More...
 

Detailed Description

This class implements battery functions.

Member Typedef Documentation

◆ ScopedFILE

using Ocean::Platform::Android::Battery::ScopedFILE = ScopedObjectCompileTimeT<FILE*, FILE*, int, pclose, 0, false >
protected

Definition of a scoped object for FILE pointers.

Member Function Documentation

◆ currentCapacity()

static float Ocean::Platform::Android::Battery::currentCapacity ( )
static

Returns the current battery capacity status in percent.

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
currentThe 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
voltageThe 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: