Go to the documentation of this file.
65 #ifndef DEVICECOMMUNICATOR_H
66 #define DEVICECOMMUNICATOR_H
71 #ifdef LOG_COMMUNICATOR_RX_TX
145 #ifdef LOG_COMMUNICATOR_RX_TX
158 #ifdef LOG_COMMUNICATOR_RX_TX
161 #ifdef LOG_COMMUNICATOR_RX_TX_TIMESTAMPED
165 void generateLogFiles();
uint32_t m_gotoConfigTimeout
A class that is used for the communcation with a device.
void loadLogFile(XsDevice *device) override
Load a complete logfile.
A list of uint8_t values.
virtual bool doTransaction(const XsMessage &msg, XsMessage &rcv, uint32_t timeout) override
Write a message and await the reply.
void handleMessage(const XsMessage &message) override
Handles a message.
XsResultValue extractMessages(const XsByteArray &rawIn, std::deque< XsMessage > &messages, RxChannelId channel=0)
Read all messages available in the incoming data stream after adding new data supplied in rawIn.
XsResultValue gotoConfig(bool) override
Request a device to go to config mode.
uint32_t gotoConfigTimeout() const
bool openLogFile(const XsString &filename) override
Open the log file `.
RxChannelId addRxChannel()
Adds an RX (receive) channel to the device communicator. Each channel maintains its own message parsi...
static const uint32_t m_defaultGotoConfigTimeout
XsResultValue
Xsens result values.
XsMessage readMessage(uint8_t msgId=0) override
Read a message from the open file.
XsSize RxChannelId
A typedef for Rx chanel ID.
bool doTransaction(const XsMessage &message)
Write a message and await the reply.
void closeLogFile() override
Close the log file.
A base struct for a communication interface.
bool writeMessage(const XsMessage &message) override
Write message to the device.
DeviceCommunicator(RxChannelId rxChannels=1)
Default constructor.
virtual XsResultValue writeRawData(const XsByteArray &data)=0
Writes a raw data to a device.
std::vector< MessageExtractor > m_messageExtractors
MessageExtractor & messageExtractor(RxChannelId=0)
Returns the message extractor for the given rx channel.
XsString logFileName() const override
~DeviceCommunicator() override
XsFilePos logFileReadPosition() const override
std::deque< XsMessage > readMessagesFromStartOfFile(uint8_t msgId, int maxMsgs=0) override
Read multiple similar messages from the start of the open file.
void setKeepAlive(bool enable) override
Does nothing.
size_t XsSize
XsSize must be unsigned number!
void abortLoadLogFile() override
Aborts loading a logfile.
virtual XsResultValue readLogFile(XsDevice *device)
Read a log file into cache.
Structure for storing a single message.
XsTimeStamp logFileDate() const override
XsFilePos logFileSize() const override
virtual XsResultValue readSinglePacketFromFile()
Read a single XsDataPacket from an open log file.
Encapsulates a file, providing a platform independent interface.
XsMessage readMessageFromStartOfFile(uint8_t msgId, int maxMsgs=0) override
Read a message from the start of the open file.
XsResultValue gotoMeasurement() override
Request a device to go to measurement mode.
RxChannelId m_nextRxChannelId
XsSize messageExtractorCount() const
Returns the number of message extractor this device communicator has.
bool isReadingFromFile() const override
void setGotoConfigTimeout(uint32_t timeout) override
Set the timeout for the gotoConfig function.
XsResultValue getDeviceId() override
Request a device to get device ID.
int64_t XsFilePos
The type that is used for positioning inside a file.
A 0-terminated managed string of characters.
This class contains method to set, retrieve and compare timestamps.
void waitForLastTaskCompletion() override
Wait for the last processing task to complete in the threadpool.
void resetLogFileReadPosition(void) override
Resets the logfile read position.