Go to the documentation of this file.
84 , m_isRestoring(false)
148 bool success =
false;
149 const size_t readDataSize = 4;
150 unsigned char resetByte = (
unsigned char)0xDE;
151 unsigned char preambleBuf[1] = { 0 };
152 unsigned char readBuf[readDataSize] = { 0, 0, 0, 0 };
173 bool stoppedByUser = !success;
179 bool restoreOk = (preambleArray[0] ==
XS_PREAMBLE && readArray[0] == 0xFF && readArray[1] == 0x3E && readArray[2] == 0x00 && readArray[3] == 0xC3);
int32_t innerFunction(void) override
Inner function for an execution on a thread.
void stop()
Stops the restore communication procedure.
A list of uint8_t values.
XBR_115k2
115k2 (115200 bps)
XsResultValue setTimeout(uint32_t ms)
Set the default timeout value to use in blocking operations.
XsResultValue close(void) override
Close the serial communication port.
XsResultValue openComPort(const XsPortInfo &portInfo)
Tries to open COM port.
SerialInterface * m_serialInterface
High level Motion Tracker (MT) management class.
@ XRV_ALREADYOPEN
269: An I/O device is already opened with this object
@ XRV_ERROR
256: A generic error occurred
XsResultValue readData(XsFilePos maxLength, XsByteArray &data) override
Read data from the serial port and put it into the data buffer.
@ XRV_OK
0: Operation was performed successfully
bool startThread(const char *name=NULL)
Starts the thread.
XsResultValue
Xsens result values.
volatile std::atomic< bool > m_isRestoring
XsResultValue start(const XsString &portName)
Starts the restore communication procedure.
Contains a descriptor for opening a communication port to an Xsens device.
@ XRV_RESTORE_COMMUNICATION_STOPPED
319: Restore communication was stopped
void onRestoreCommunication(const XsString *portName, XsResultValue result) override
The Xscallback::onRestoreCommunication callback forwarding function.
XsResultValue open(const XsPortInfo &portInfo, XsFilePos readBufSize=XS_DEFAULT_READ_BUFFER_SIZE, XsFilePos writeBufSize=XS_DEFAULT_WRITE_BUFFER_SIZE, PortOptions options=PO_XsensDefaults) override
Open a communication channel to the given port info.
RestoreCommunication(XsControl *control)
Constructor.
@ XRV_RESTORE_COMMUNICATION_FAILED
318: Restore communication failed
The low-level serial communication class.
XsResultValue writeData(const XsByteArray &data, XsFilePos *written=0) override
Write the data contained in data to the device.
void stopThread(void) noexcept
Tells the thread to stop and waits for it to end.
~RestoreCommunication()
Destructor.
int64_t XsFilePos
The type that is used for positioning inside a file.
A 0-terminated managed string of characters.