YARP
Yet Another Robot Platform
upowerBattery.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * All rights reserved.
4  *
5  * This software may be modified and distributed under the terms of the
6  * BSD-3-Clause license. See the accompanying LICENSE file for details.
7  */
8 
9 #ifndef YARP_UPOWERBATTERY_H
10 #define YARP_UPOWERBATTERY_H
11 
12 #include <yarp/dev/IBattery.h>
13 #include <yarp/dev/PolyDriver.h>
14 
15 #include <QDBusInterface>
16 
17 
20  public yarp::dev::IBattery
21 {
22 public:
23  UpowerBattery() = default;
24  UpowerBattery(const UpowerBattery&) = delete;
28 
29  ~UpowerBattery() override = default;
30 
31  bool open(yarp::os::Searchable& config) override;
32  bool close() override;
33 
34  bool getBatteryVoltage(double& voltage) override;
35  bool getBatteryCurrent(double& current) override;
36  bool getBatteryCharge(double& charge) override;
37  bool getBatteryStatus(Battery_status& status) override;
38  bool getBatteryInfo(std::string& info) override;
39  bool getBatteryTemperature(double& temperature) override;
40 
41 private:
42  QDBusInterface *m_interface { nullptr };
43 };
44 
45 #endif
bool getBatteryCurrent(double &current) override
Get the instantaneous current measurement.
UpowerBattery & operator=(const UpowerBattery &)=delete
bool getBatteryStatus(Battery_status &status) override
get the battery status
UpowerBattery(const UpowerBattery &)=delete
UpowerBattery(UpowerBattery &&)=delete
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
bool close() override
Close the DeviceDriver.
~UpowerBattery() override=default
bool getBatteryTemperature(double &temperature) override
get the battery temperature
bool getBatteryCharge(double &charge) override
get the battery status of charge
bool getBatteryVoltage(double &voltage) override
Get the instantaneous voltage measurement.
bool getBatteryInfo(std::string &info) override
get the battery hardware characteristics (e.g.
UpowerBattery()=default
UpowerBattery & operator=(UpowerBattery &&)=delete
Interface implemented by all device drivers.
Definition: DeviceDriver.h:38
A generic battery interface.
Definition: IBattery.h:33
A base class for nested structures that can be searched.
Definition: Searchable.h:69