Go to the documentation of this file.
65 #ifndef SERIALCOMMUNICATOR_H
66 #define SERIALCOMMUNICATOR_H
void flushPort() override
Flushes all remaining data on the open port.
XsVersion m_firmwareRevision
A class that is used for the communcation with a device.
XsResultValue writeRawData(const XsByteArray &data) override
Write raw data to the open COM or USB port.
XsResultValue processBufferedData(const XsByteArray &rawIn, std::deque< XsMessage > &messages) override
Read all messages from the buffered read data after adding new data supplied in rawIn.
virtual uint32_t defaultInterfaceTimeout() const
A list of uint8_t values.
OpenPortStage
Port opening stages.
A class that uses serial communication.
void setDoGotoConfig(bool doit)
Sets do go to config in a thread.
XsPortInfo portInfo() const override
std::shared_ptr< StreamInterface > m_streamInterface
virtual std::shared_ptr< StreamInterface > createStreamInterface(const XsPortInfo &pi)=0
Creates a stream interface.
void handleMessage(const XsMessage &msg) override
Handles a message.
bool isDockedAt(Communicator *other) const override
XsVersion hardwareRevision()
void startPollThread()
Starts polling the thread.
void stopPollThread()
Stops polling the thread.
XsResultValue
Xsens result values.
A base struct for a communication interface.
XsResultValue gotoConfig(bool detectRs485=false) override
Request a device to go to config mode.
A class that implements thread for MT.
Contains a descriptor for opening a communication port to an Xsens device.
XsVersion m_hardwareRevision
virtual XsResultValue getFirmwareRevision()
Requests the firmware revision from the connected device.
SerialCommunicator()
Default constructor.
A class to store version information.
void closePort() override
Closes the port.
Structure for storing a single message.
XsPortInfo m_activePortInfo
The information about the port this communicator is currently connected to.
XsVersion firmwareRevision()
virtual void prepareForDestruction() override
Prepares for a destruction.
A class for the data parsing on a separete thread.
bool openPort(const XsPortInfo &portInfo, OpenPortStage stage=OPS_Full, bool detectRs485=false) override
Open a serial port and return the main device connected to it.
virtual XsResultValue getHardwareRevision()
Requests the hardware revision from the connected device.
virtual ~SerialCommunicator()
XsResultValue gotoMeasurement() override
Request a device to go to measurement mode.
XsResultValue readDataToBuffer(XsByteArray &raw) override
Read available data from the open IO device.
bool isPortOpen() const override
bool reopenPort(OpenPortStage stage=OPS_Full, bool skipDeviceIdCheck=false) override
Reopens the port.