7#ifndef __BCBBATTERY_H__
8#define __BCBBATTERY_H__
11#include <yarp/conf/version.h>
12#include <yarp/os/PeriodicThread.h>
13#include <yarp/dev/IBattery.h>
14#include <yarp/dev/PolyDriver.h>
15#include <yarp/dev/ISerialDevice.h>
16#include <yarp/os/ResourceFinder.h>
17#include <yarp/sig/Vector.h>
20using namespace yarp::os;
49 IBattery::Battery_status
battery_status = IBattery::Battery_status::BATTERY_OK_STANDBY;
52 PeriodicThread((double)period),
60 std::string c_exp (
"\\0.......\\r\\n(?!.*\\0.......\\r\\n)");
68 virtual void run()
override;
71class BcbBattery:
public yarp::dev::IBattery,
public DeviceDriver
84 virtual bool open(yarp::os::Searchable& config);
virtual bool getBatteryVoltage(double &voltage) override
virtual bool getBatteryTemperature(double &temperature) override
virtual bool open(yarp::os::Searchable &config)
virtual bool getBatteryInfo(std::string &info) override
virtual bool getBatteryCharge(double &charge) override
virtual bool getBatteryCurrent(double ¤t) override
batteryReaderThread * batteryReader
virtual bool getBatteryStatus(Battery_status &status) override
IBattery::Battery_status battery_status
virtual void run() override
virtual void threadRelease() override
virtual bool threadInit() override
unsigned char packet[packet_len]
batteryReaderThread(ISerialDevice *_iSerial, double period)
char debugTextBuffer[debugTextBufferSize]
static const int debugTextBufferSize
unsigned char tmp_buff[buff_len]
static const int packet_len
static const int buff_len