1 #ifndef XSENS_MONOLITHIC 24 #ifndef XSENS_MONOLITHIC 37 int32_t
findValidMessage(
const uint8_t* buffer,
const uint16_t bufferLength);
60 int32_t m_onMessageReceivedInstance;
62 void* m_onMessageReceivedParam;
71 int32_t m_onMessageSentInstance;
73 void* m_onMessageSentParam;
207 Cmt1f* getCmt1f(
void);
XsensResultValue writeMessage(Message *msg)
Send a message over the COM port.
Definition: cmt2.cpp:536
Cmt1s * getCmt1s(void)
Return a reference to the embedded Cmt1s object.
Definition: cmt2.h:107
XsensResultValue getPortName(char *portname) const
Definition: cmt2.cpp:134
Contains the FIFO queue interface and implementation (inline)
Cmt1f m_cmt1f
The Cmt1f object that is used for the low-level operations.
Definition: cmt2.h:187
bool m_readOnly
When set to true, the file is read-only and attempts to write to it will fail.
Definition: cmt2.h:191
XsensResultValue setTimeout(const uint32_t ms=CMT2_DEFAULT_TIMEOUT)
Set the default timeout value to use in blocking operations.
Definition: cmt2.cpp:342
The low-level serial communication class.
Definition: cmt1.h:67
#define CMT_DEFAULT_BAUD_RATE
The default baud rate of the Cmt1s serial communication.
Definition: cmtdef.h:828
CmtCallbackType
Definition: cmtdef.h:1101
Cmt2s()
Default constructor, initialize all members to their default values.
Definition: cmt2.cpp:102
uint32_t m_timeout
Timeout in ms for blocking operations.
Definition: cmt2.h:87
XsensResultValue
Xsens return values.
Definition: xsens_std.h:43
bool isOpen(void) const
Return whether the communication port is open or not.
Definition: cmt2.h:117
#define CMT2_DEFAULT_TIMEOUT
Timeout in ms for level 2.
Definition: cmtdef.h:837
XsensResultValue getLastResult(void) const
Return the error code of the last operation.
Definition: cmt2.h:109
uint16_t m_readBufferCount
The number of valid bytes in the readBuffer.
Definition: cmt2.h:85
uint32_t getBaudrate(void) const
Return the baudrate that is currently being used by the port.
Definition: cmt1.cpp:298
XsensResultValue waitForMessage(Message *rcv, const uint8_t msgId, uint32_t timeoutOverride, bool acceptErrorMessage)
Wait for a message to arrive.
Definition: cmt2.cpp:354
The low-level file communication class.
Definition: cmt1.h:217
~Cmt2s()
Destructor, de-initialize, free memory allocated for buffers, etc.
Definition: cmt2.cpp:115
uint32_t getBaudrate(void)
Return the baudrate that is currently being used by the port.
Definition: cmt2.h:101
XsensResultValue setCallbackFunction(CmtCallbackType tp, int32_t instance, CmtCallbackFunction func, void *param)
Set the callback function for when a message has been received or sent.
Definition: cmt2.cpp:320
Class for storing a single message.
Definition: cmtmessage.h:76
int32_t findValidMessage(const uint8_t *buffer, const uint16_t bufferLength)
Find a valid message in the given buffer. If nothing is found, the function returns -1...
Definition: cmt2.cpp:36
uint8_t m_readBuffer[CMT_DEFAULT_READ_BUFFER_SIZE]
Buffer for reading data until a valid message is read. Should be rarely used.
Definition: cmt2.h:83
#define CMT_DEFAULT_WRITE_BUFFER_SIZE
The default size of the serial write buffer in bytes.
Definition: cmtdef.h:826
XsensResultValue readMessage(Message *rcv)
Read a message from the COM port.
Definition: cmt2.cpp:191
void(__cdecl * CmtCallbackFunction)(int32_t instance, int32_t callbackType, void *param, void *userParam)
Function prototype for Cmt callback functions.
Definition: cmtdef.h:1134
XsensResultValue getPortNr(uint16_t &port) const
Retrieve the port that the object is connected to.
Definition: cmt2.cpp:145
Mid-level serial communication class.
Definition: cmt2.h:48
XsensResultValue m_lastResult
The last result of an operation.
Definition: cmt2.h:81
XsensResultValue open(const char *portName, const uint32_t baudRate=CMT_DEFAULT_BAUD_RATE, uint32_t readBufSize=CMT_DEFAULT_READ_BUFFER_SIZE, uint32_t writeBufSize=CMT_DEFAULT_WRITE_BUFFER_SIZE)
Open a communication channel to the given serial port name.
Definition: cmt2.cpp:165
Cmt1s m_cmt1s
The CMT level 1 object that this class operates on.
Definition: cmt2.h:79
The namespace of all Xsens software since 2006.
Definition: cmt1.cpp:62
uint32_t getTimeout(void) const
Return the current timeout value in ms.
Definition: cmt2.h:115
Contains the CMT Level 1 interface.
#define CMT_DEFAULT_READ_BUFFER_SIZE
The default size of the serial read buffer in bytes.
Definition: cmtdef.h:824
Contains the CMT Message interface.
uint32_t m_baudrate
The baudrate that was last set to be used by the port.
Definition: cmt2.h:77
XsensResultValue close(void)
Close the serial communication port.
Definition: cmt2.cpp:120
bool isOpen(void) const
Return whether the communication port is open or not.
Definition: cmt1.cpp:310
XsensResultValue m_lastResult
The last result of an operation.
Definition: cmt2.h:189
__off64_t XsensFilePos
Definition: xsens_file.h:21
The mid-level file communication class.
Definition: cmt2.h:180
uint32_t m_toEnd
The timestamp at which to end an operation.
Definition: cmt2.h:89