9 #ifndef _EMBOBJCANBATTERYSENSORS_H_
10 #define _EMBOBJCANBATTERYSENSORS_H_
12 #include <yarp/dev/DeviceDriver.h>
13 #include <yarp/dev/MultipleAnalogSensorsInterfaces.h>
14 #include <yarp/dev/IBattery.h>
15 #include <yarp/sig/Vector.h>
18 #include <shared_mutex>
45 void decode(eOas_battery_timedvalue_t *
data,
double timestamp);
54 embObjBattery(std::shared_ptr<yarp::dev::embObjDevPrivData> device);
57 bool open(yarp::os::Searchable &config);
63 bool update(eOprotID32_t id32,
double timestamp,
void *rxdata)
override;
76 std::shared_ptr<yarp::dev::embObjDevPrivData>
device_;
88 std::vector<yarp::dev::MAS_status>
masStatus_{MAS_OK, MAS_OK, MAS_OK, MAS_OK};
bool operator==(const CanBatteryData &other) const
void decode(eOas_battery_timedvalue_t *data, double timestamp)
bool operator!=(const CanBatteryData &other) const
eth::iethresType_t type() override
bool open(yarp::os::Searchable &config)
eOabstime_t firstCanTimestamp_
std::string updateStatusStringStream(const uint16_t &currStatus, const uint16_t &prevStatus, bool isFirstLoop)
bool initialised() override
std::map< eOprotID32_t, eOabstime_t > timeoutUpdate_
double firstYarpTimestamp_
bool sendConfig2boards(ServiceParserCanBattery &parser, eth::AbstractEthResource *deviceRes)
bool getBatteryVoltage(double &voltage) override
static constexpr bool useBoardTimeFlag_
static constexpr eOabstime_t updateTimeout_
virtual double calculateBoardTime(eOabstime_t current)
bool getBatteryStatus(Battery_status &status) override
bool getBatteryCurrent(double ¤t) override
bool checkUpdateTimeout(eOprotID32_t id32, eOabstime_t current)
std::shared_ptr< yarp::dev::embObjDevPrivData > device_
bool getBatteryInfo(std::string &battery_info) override
bool sendStart2boards(ServiceParserCanBattery &parser, eth::AbstractEthResource *deviceRes)
std::vector< yarp::dev::MAS_status > masStatus_
bool initRegulars(ServiceParserCanBattery &parser, eth::AbstractEthResource *deviceRes)
bool update(eOprotID32_t id32, double timestamp, void *rxdata) override
static constexpr bool checkUpdateTimeoutFlag_
CanBatteryData canBatteryData_
bool getBatteryTemperature(double &temperature) override
bool getBatteryCharge(double &charge) override