Go to the documentation of this file.
86 : m_channelId(channelId)
87 , m_channelLatency(channelLatency)
127 auto result = [
this]()
140 return (this->
portInfo() == portInfo);
235 snprintf(tmp,
sizeof(tmp),
"PROXY#%d", channelId);
bool isPortOpen() const override
Checks if the associated port is open.
uint32_t defaultInterfaceTimeout() const override
Returns the default timeout needed for this interface.
A list of uint8_t values.
XsResultValue writeRawData(const XsByteArray &data) override
Writes raw data to the communication channel.
OpenPortStage
Port opening stages.
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.
bool openPort(const XsPortInfo &portInfo, OpenPortStage stage=OPS_Full, bool detectRs485=false) override
Opens a proxy port.
bool doTransaction(const XsMessage &msg, XsMessage &rcv, uint32_t timeout) override
Write a message and await the reply.
XsPortInfo portInfo() const override
XsDeviceId masterDeviceId() const
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 processBufferedData(const XsByteArray &rawIn, std::deque< XsMessage > &messages) override
Read all messages from the buffered read data after adding new data supplied in rawIn.
A class which re-detects a device with a certain device Id.
bool isDockedAt(Communicator *other) const override
Has no effect for the ProxyCommunicator. Always returns false.
void closePort() override
Closes the port.
@ XRV_ALREADYOPEN
269: An I/O device is already opened with this object
@ XRV_OK
0: Operation was performed successfully
bool reopenPort(OpenPortStage stage=OPS_Full, bool skipDeviceIdCheck=false) override
Closes and tries to reopen the port.
XsResultValue
Xsens result values.
XsResultValue lastResult() const
Get the result value of the last operation.
bool redetect(const XsDeviceId &deviceId, XsPortInfo &portInfo, bool skipDeviceIdCheck=false)
Base redetect function which calls the appropriate redetect based on deviceId.
void handleMessage(const XsMessage &message) override
Handles a message received on the communication channel.
A base struct for a communication interface.
struct XsPortInfo XsPortInfo
XsResultValue gotoConfig(bool detectRs485=false) override
Request a device to go to config mode.
Contains a descriptor for opening a communication port to an Xsens device.
static XsPortInfo createPortInfo(int channelId)
Creates a default port info object based on the given user-provided channel identifier.
Structure for storing a single message.
uint32_t m_channelLatency
XsPortInfo m_activePortInfo
The information about the port this communicator is currently connected to.
ProxyCommunicator(int channelId, uint32_t channelLatency)
Constructor.
void onTransmissionRequest(int channelId, const XsByteArray *data) override
XsResultValue readDataToBuffer(XsByteArray &raw) override
Has no effect for the ProxyCommunicator.
void handleReceivedData(const XsByteArray &data)
Handles data received from the communication channel.
virtual void prepareForDestruction() override
Prepares for a destruction.
XsResultValue getDeviceId() override
Request a device to get device ID.
~ProxyCommunicator() override
Destructor.
void setLastResult(XsResultValue lastResult, XsString const &text=XsString()) const
Sets the last result.
void flushPort() override
Flushes all remaining data on the open port. Has no effect for the ProxyCommunicator.
void addRawData(const XsByteArray &arr)
Adds the raw data to an array.