41 std::lock_guard<std::mutex> lock(
m_mutex);
74 std::lock_guard<std::mutex> lock(
m_mutex);
85 std::lock_guard<std::mutex> lock(
m_mutex);
92 std::lock_guard<std::mutex> lock(
m_mutex);
99 std::lock_guard<std::mutex> lock(
m_mutex);
106 std::lock_guard<std::mutex> lock(
m_mutex);
113 std::lock_guard<std::mutex> lock(
m_mutex);
120 std::lock_guard<std::mutex> lock(
m_mutex);
127 std::lock_guard<std::mutex> lock(
m_mutex);
135 std::lock_guard<std::mutex> lock(
m_mutex);
143 std::lock_guard<std::mutex> lock(
m_mutex);
151 std::lock_guard<std::mutex> lock(
m_mutex);
158 std::lock_guard<std::mutex> lock(
m_mutex);
164 std::lock_guard<std::mutex> lock(
m_mutex);
170 std::lock_guard<std::mutex> lock(
m_mutex);
176 std::lock_guard<std::mutex> lock(
m_mutex);
182 std::lock_guard<std::mutex> lock(
m_mutex);
188 std::lock_guard<std::mutex> lock(
m_mutex);
195 std::lock_guard<std::mutex> lock(
m_mutex);
198 return "0: BATTERY_OK_STANDBY";
200 return "1: BATTERY_OK_IN_CHARGE";
202 return "2: BATTERY_OK_IN_USE";
204 return "3: BATTERY_GENERAL_ERROR";
206 return "4: BATTERY_TIMEOUT";
208 return "5: BATTERY_LOW_WARNING";
210 return "6: BATTERY_CRITICAL_WARNING";
212 return "Invalid battery status";
218 std::lock_guard<std::mutex> lock(
m_mutex);
224 std::lock_guard<std::mutex> lock(
m_mutex);
229void FakeBattery::updateStatus()
constexpr double default_period
bool parseParams(const yarp::os::Searchable &config) override
Parse the DeviceDriver parameters.
std::string m_rpc_port_name
fakeBattery: Documentation to be added
void setBatteryTemperature(const double temperature) override
double getBatteryCharge() override
std::string getBatteryInfo() override
double battery_temperature
void setBatteryStatus(const yarp::dev::IBattery::Battery_status status) override
void setBatteryInfo(const std::string &info) override
Battery_status getBatteryStatus() override
yarp::os::RpcServer ctrl_port
void setBatteryCurrent(const double current) override
void run() override
Loop function.
Battery_status battery_status
bool suspend_battery_status_update
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
void setBatteryVoltage(const double voltage) override
bool close() override
Close the DeviceDriver.
void setBatteryCharge(const double charge) override
double getBatteryVoltage() override
double getBatteryCurrent() override
std::string getBatteryStatusString() override
double getBatteryTemperature() override
@ BATTERY_CRITICAL_WARNING
A mini-server for performing network communication in the background.
An abstraction for a periodic thread.
bool setPeriod(double period)
Set the (new) period of the thread.
bool start()
Call this to start the thread.
void stop()
Call this to stop the thread, this call blocks until the thread is terminated (and releaseThread() ca...
A base class for nested structures that can be searched.
bool attachAsServer(yarp::os::UnbufferedContactable &port)
Tag this WireLink as a server, receiving commands via the specified port.
yarp::os::WireLink & yarp()
Get YARP state associated with this object.
#define yCInfo(component,...)
#define yCError(component,...)
#define YARP_LOG_COMPONENT(name,...)
constexpr const T & clamp(const T &v, const T &lo, const T &hi)
For streams capable of holding different kinds of content, check what they actually have.
An interface to the operating system, including Port based communication.