YARP
Yet Another Robot Platform

upowerBattery: A device to view the battery of a linux laptop in YARP using the yarp::dev::IBattery interface. More...

#include <upowerBattery/upowerBattery.h>

+ Inheritance diagram for UpowerBattery:

Public Member Functions

 UpowerBattery ()=default
 
 UpowerBattery (const UpowerBattery &)=delete
 
 UpowerBattery (UpowerBattery &&)=delete
 
UpowerBatteryoperator= (const UpowerBattery &)=delete
 
UpowerBatteryoperator= (UpowerBattery &&)=delete
 
 ~UpowerBattery () override=default
 
bool open (yarp::os::Searchable &config) override
 Open the DeviceDriver. More...
 
bool close () override
 Close the DeviceDriver. More...
 
bool getBatteryVoltage (double &voltage) override
 Get the instantaneous voltage measurement. More...
 
bool getBatteryCurrent (double &current) override
 Get the instantaneous current measurement. More...
 
bool getBatteryCharge (double &charge) override
 get the battery status of charge More...
 
bool getBatteryStatus (Battery_status &status) override
 get the battery status More...
 
bool getBatteryInfo (std::string &info) override
 get the battery hardware characteristics (e.g. More...
 
bool getBatteryTemperature (double &temperature) override
 get the battery temperature More...
 
- Public Member Functions inherited from yarp::dev::DeviceDriver
 ~DeviceDriver () override=default
 Destructor. More...
 
template<class T >
bool view (T *&x)
 Get an interface to the device driver. More...
 
virtual DeviceDrivergetImplementation ()
 Some drivers are bureaucrats, pointing at others. More...
 
- Public Member Functions inherited from yarp::os::IConfig
virtual ~IConfig ()
 Destructor. More...
 
virtual bool configure (Searchable &config)
 Change online parameters. More...
 
- Public Member Functions inherited from yarp::dev::IBattery
virtual ~IBattery ()
 

Additional Inherited Members

- Public Types inherited from yarp::dev::IBattery
enum  Battery_status {
  BATTERY_OK_STANBY = 0 ,
  BATTERY_OK_IN_CHARGE = 1 ,
  BATTERY_OK_IN_USE = 2 ,
  BATTERY_GENERAL_ERROR = 3 ,
  BATTERY_TIMEOUT = 4 ,
  BATTERY_LOW_WARNING = 5 ,
  BATTERY_CRITICAL_WARNING = 6
}
 

Detailed Description

upowerBattery: A device to view the battery of a linux laptop in YARP using the yarp::dev::IBattery interface.

Documentation to be added

Definition at line 22 of file upowerBattery.h.

Constructor & Destructor Documentation

◆ UpowerBattery() [1/3]

UpowerBattery::UpowerBattery ( )
default

◆ UpowerBattery() [2/3]

UpowerBattery::UpowerBattery ( const UpowerBattery )
delete

◆ UpowerBattery() [3/3]

UpowerBattery::UpowerBattery ( UpowerBattery &&  )
delete

◆ ~UpowerBattery()

UpowerBattery::~UpowerBattery ( )
overridedefault

Member Function Documentation

◆ close()

bool UpowerBattery::close ( )
overridevirtual

Close the DeviceDriver.

Returns
true/false on success/failure.

Reimplemented from yarp::dev::DeviceDriver.

Definition at line 46 of file upowerBattery.cpp.

◆ getBatteryCharge()

bool UpowerBattery::getBatteryCharge ( double &  charge)
overridevirtual

get the battery status of charge

Parameters
chargethe charge measurement (0-100%)
Returns
true/false.

Implements yarp::dev::IBattery.

Definition at line 70 of file upowerBattery.cpp.

◆ getBatteryCurrent()

bool UpowerBattery::getBatteryCurrent ( double &  current)
overridevirtual

Get the instantaneous current measurement.

Parameters
currentthe current measurement
Returns
true/false.

Implements yarp::dev::IBattery.

Definition at line 58 of file upowerBattery.cpp.

◆ getBatteryInfo()

bool UpowerBattery::getBatteryInfo ( std::string &  battery_info)
overridevirtual

get the battery hardware characteristics (e.g.

max voltage etc)

Parameters
astring containing the battery infos
Returns
true/false.

Implements yarp::dev::IBattery.

Definition at line 127 of file upowerBattery.cpp.

◆ getBatteryStatus()

bool UpowerBattery::getBatteryStatus ( Battery_status status)
overridevirtual

get the battery status

Parameters
statusthe battery status
Returns
true/false.

Implements yarp::dev::IBattery.

Definition at line 76 of file upowerBattery.cpp.

◆ getBatteryTemperature()

bool UpowerBattery::getBatteryTemperature ( double &  temperature)
overridevirtual

get the battery temperature

Parameters
temperaturethe battery temperature
Returns
true/false.

Implements yarp::dev::IBattery.

Definition at line 121 of file upowerBattery.cpp.

◆ getBatteryVoltage()

bool UpowerBattery::getBatteryVoltage ( double &  voltage)
overridevirtual

Get the instantaneous voltage measurement.

Parameters
voltagethe voltage measurement
Returns
true/false.

Implements yarp::dev::IBattery.

Definition at line 52 of file upowerBattery.cpp.

◆ open()

bool UpowerBattery::open ( yarp::os::Searchable config)
overridevirtual

Open the DeviceDriver.

Parameters
configis a list of parameters for the device. Which parameters are effective for your device can vary. See device invocation examples. If there is no example for your device, you can run the "yarpdev" program with the verbose flag set to probe what parameters the device is checking. If that fails too, you'll need to read the source code (please nag one of the yarp developers to add documentation for your device).
Returns
true/false upon success/failure

Reimplemented from yarp::dev::DeviceDriver.

Definition at line 30 of file upowerBattery.cpp.

◆ operator=() [1/2]

UpowerBattery& UpowerBattery::operator= ( const UpowerBattery )
delete

◆ operator=() [2/2]

UpowerBattery& UpowerBattery::operator= ( UpowerBattery &&  )
delete

The documentation for this class was generated from the following files: