7#include <boost/algorithm/string.hpp>
8#include <boost/array.hpp>
9#include <boost/asio.hpp>
10#include <boost/chrono.hpp>
11#include <boost/make_shared.hpp>
12#include <boost/shared_ptr.hpp>
13#include <boost/thread.hpp>
59 RebotBackend(std::string boardAddr, std::string port,
const std::string& mapFileName =
"",
65 void read(uint8_t bar, uint32_t addressInBytes, int32_t* data,
size_t sizeInBytes)
override;
66 void write(uint8_t bar, uint32_t addressInBytes, int32_t
const* data,
size_t sizeInBytes)
override;
70 std::string address, std::map<std::string, std::string> parameters);
75 void heartbeatLoop(
const boost::shared_ptr<ThreadInformerMutex>& threadInformerMutex);
Base class for address-based device backends (e.g.
Handles the communication over TCP protocol with RebotDevice-based devices.
boost::chrono::steady_clock::time_point _lastSendTime
The time when the last command (read/write/heartbeat) was send.
void open() override
The function opens the connection to the device.
boost::thread _heartbeatThread
boost::shared_ptr< ThreadInformerMutex > _threadInformerMutex
unsigned int _connectionTimeout
size_t minimumTransferAlignment(uint64_t bar) const override
Determines the supported minimum alignment for any read/write requests.
void heartbeatLoop(const boost::shared_ptr< ThreadInformerMutex > &threadInformerMutex)
std::unique_ptr< RebotProtocolImplementor > _protocolImplementor
std::string readDeviceInfo() override
Return a device information string containing hardware details like the firmware version number or th...
static const uint32_t DEFAULT_CONNECTION_TIMEOUT_sec
boost::shared_ptr< Rebot::Connection > _connection
void closeImpl() override
All backends derrived from NumericAddressedBackend must implement closeImpl() instead of close.
static boost::shared_ptr< DeviceBackend > createInstance(std::string address, std::map< std::string, std::string > parameters)
This is the base class of the code which implements the ReboT protocol.