iCub-main
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
yarp::dev::embObjBattery Class Reference

#include <embObjBattery.h>

+ Inheritance diagram for yarp::dev::embObjBattery:

Public Member Functions

 embObjBattery ()
 
 embObjBattery (std::shared_ptr< yarp::dev::embObjDevPrivData > device)
 
 ~embObjBattery ()
 
bool open (yarp::os::Searchable &config)
 
bool close ()
 
bool initialised () override
 
eth::iethresType_t type () override
 
bool update (eOprotID32_t id32, double timestamp, void *rxdata) override
 
bool getBatteryVoltage (double &voltage) override
 
bool getBatteryCurrent (double &current) override
 
bool getBatteryCharge (double &charge) override
 
bool getBatteryStatus (Battery_status &status) override
 
bool getBatteryTemperature (double &temperature) override
 
bool getBatteryInfo (std::string &battery_info) override
 
virtual double calculateBoardTime (eOabstime_t current)
 
- Public Member Functions inherited from eth::IethResource
virtual ~IethResource ()
 
const char * stringOfType ()
 
virtual bool getEntityName (uint32_t entityId, std::string &entityName)
 

Protected Member Functions

bool sendConfig2boards (ServiceParserCanBattery &parser, eth::AbstractEthResource *deviceRes)
 
bool sendStart2boards (ServiceParserCanBattery &parser, eth::AbstractEthResource *deviceRes)
 
bool initRegulars (ServiceParserCanBattery &parser, eth::AbstractEthResource *deviceRes)
 
void cleanup (void)
 
bool checkUpdateTimeout (eOprotID32_t id32, eOabstime_t current)
 
std::string updateStatusStringStream (const uint16_t &currStatus, const uint16_t &prevStatus, bool isFirstLoop)
 

Protected Attributes

std::shared_ptr< yarp::dev::embObjDevPrivDatadevice_
 
std::shared_mutex mutex_
 
CanBatteryData canBatteryData_
 
std::map< eOprotID32_t, eOabstime_t > timeoutUpdate_
 
std::vector< yarp::dev::MAS_status > masStatus_ {MAS_OK, MAS_OK, MAS_OK, MAS_OK}
 
bool isCanDataAvailable = false
 
bool isPastFirstPrint = false
 
double firstYarpTimestamp_ {0}
 
eOabstime_t firstCanTimestamp_ {0}
 

Static Protected Attributes

static constexpr eOabstime_t updateTimeout_ {11000}
 
static constexpr bool checkUpdateTimeoutFlag_ {false}
 
static constexpr bool useBoardTimeFlag_ {true}
 

Detailed Description

Definition at line 50 of file embObjBattery.h.

Constructor & Destructor Documentation

◆ embObjBattery() [1/2]

embObjBattery::embObjBattery ( )

Definition at line 46 of file embObjBattery.cpp.

◆ embObjBattery() [2/2]

embObjBattery::embObjBattery ( std::shared_ptr< yarp::dev::embObjDevPrivData device)

Definition at line 52 of file embObjBattery.cpp.

◆ ~embObjBattery()

embObjBattery::~embObjBattery ( )

Definition at line 56 of file embObjBattery.cpp.

Member Function Documentation

◆ calculateBoardTime()

double embObjBattery::calculateBoardTime ( eOabstime_t  current)
virtual

Definition at line 396 of file embObjBattery.cpp.

◆ checkUpdateTimeout()

bool embObjBattery::checkUpdateTimeout ( eOprotID32_t  id32,
eOabstime_t  current 
)
protected

Definition at line 294 of file embObjBattery.cpp.

◆ cleanup()

void embObjBattery::cleanup ( void  )
protected

Definition at line 289 of file embObjBattery.cpp.

◆ close()

bool embObjBattery::close ( void  )

Definition at line 283 of file embObjBattery.cpp.

◆ getBatteryCharge()

bool embObjBattery::getBatteryCharge ( double &  charge)
override

Definition at line 425 of file embObjBattery.cpp.

◆ getBatteryCurrent()

bool embObjBattery::getBatteryCurrent ( double &  current)
override

Definition at line 419 of file embObjBattery.cpp.

◆ getBatteryInfo()

bool embObjBattery::getBatteryInfo ( std::string &  battery_info)
override

Definition at line 443 of file embObjBattery.cpp.

◆ getBatteryStatus()

bool embObjBattery::getBatteryStatus ( Battery_status &  status)
override

Definition at line 431 of file embObjBattery.cpp.

◆ getBatteryTemperature()

bool embObjBattery::getBatteryTemperature ( double &  temperature)
override

Definition at line 437 of file embObjBattery.cpp.

◆ getBatteryVoltage()

bool embObjBattery::getBatteryVoltage ( double &  voltage)
override

Definition at line 413 of file embObjBattery.cpp.

◆ initialised()

bool embObjBattery::initialised ( )
overridevirtual

Implements eth::IethResource.

Definition at line 61 of file embObjBattery.cpp.

◆ initRegulars()

bool embObjBattery::initRegulars ( ServiceParserCanBattery parser,
eth::AbstractEthResource deviceRes 
)
protected

Definition at line 191 of file embObjBattery.cpp.

◆ open()

bool embObjBattery::open ( yarp::os::Searchable &  config)

Definition at line 66 of file embObjBattery.cpp.

◆ sendConfig2boards()

bool embObjBattery::sendConfig2boards ( ServiceParserCanBattery parser,
eth::AbstractEthResource deviceRes 
)
protected

Definition at line 146 of file embObjBattery.cpp.

◆ sendStart2boards()

bool embObjBattery::sendStart2boards ( ServiceParserCanBattery parser,
eth::AbstractEthResource deviceRes 
)
protected

Definition at line 168 of file embObjBattery.cpp.

◆ type()

eth::iethresType_t embObjBattery::type ( )
overridevirtual

Implements eth::IethResource.

Definition at line 223 of file embObjBattery.cpp.

◆ update()

bool embObjBattery::update ( eOprotID32_t  id32,
double  timestamp,
void *  rxdata 
)
overridevirtual

Implements eth::IethResource.

Definition at line 228 of file embObjBattery.cpp.

◆ updateStatusStringStream()

std::string embObjBattery::updateStatusStringStream ( const uint16_t &  currStatus,
const uint16_t &  prevStatus,
bool  isFirstLoop 
)
protected

Definition at line 314 of file embObjBattery.cpp.

Member Data Documentation

◆ canBatteryData_

CanBatteryData yarp::dev::embObjBattery::canBatteryData_
protected

Definition at line 78 of file embObjBattery.h.

◆ checkUpdateTimeoutFlag_

constexpr bool yarp::dev::embObjBattery::checkUpdateTimeoutFlag_ {false}
staticconstexprprotected

Definition at line 90 of file embObjBattery.h.

◆ device_

std::shared_ptr<yarp::dev::embObjDevPrivData> yarp::dev::embObjBattery::device_
protected

Definition at line 76 of file embObjBattery.h.

◆ firstCanTimestamp_

eOabstime_t yarp::dev::embObjBattery::firstCanTimestamp_ {0}
protected

Definition at line 97 of file embObjBattery.h.

◆ firstYarpTimestamp_

double yarp::dev::embObjBattery::firstYarpTimestamp_ {0}
protected

Definition at line 96 of file embObjBattery.h.

◆ isCanDataAvailable

bool yarp::dev::embObjBattery::isCanDataAvailable = false
protected

Definition at line 93 of file embObjBattery.h.

◆ isPastFirstPrint

bool yarp::dev::embObjBattery::isPastFirstPrint = false
protected

Definition at line 94 of file embObjBattery.h.

◆ masStatus_

std::vector<yarp::dev::MAS_status> yarp::dev::embObjBattery::masStatus_ {MAS_OK, MAS_OK, MAS_OK, MAS_OK}
protected

Definition at line 88 of file embObjBattery.h.

◆ mutex_

std::shared_mutex yarp::dev::embObjBattery::mutex_
mutableprotected

Definition at line 77 of file embObjBattery.h.

◆ timeoutUpdate_

std::map<eOprotID32_t, eOabstime_t> yarp::dev::embObjBattery::timeoutUpdate_
protected

Definition at line 79 of file embObjBattery.h.

◆ updateTimeout_

constexpr eOabstime_t yarp::dev::embObjBattery::updateTimeout_ {11000}
staticconstexprprotected

Definition at line 87 of file embObjBattery.h.

◆ useBoardTimeFlag_

constexpr bool yarp::dev::embObjBattery::useBoardTimeFlag_ {true}
staticconstexprprotected

Definition at line 91 of file embObjBattery.h.


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