53 "Message(%02x, %hu, %hu): buffer = %p\n", (
int32_t)msgId,
length,
99 length = ((
uint16_t)tmp->m_datlen.m_extended.m_length.m_high * 256 +
100 (
uint16_t)tmp->m_datlen.m_extended.m_length.m_low) +
111 "Message(%02x%02x%02x%02x%02x%02x, %hu, %hu): buffer = %p\n",
source[0],
209 ret = ((double)tmp) / 1048576.0;
261 return (
double)fp.
i64 / 4294967296.0;
294 for (
uint16_t i = 0; i < numValues; i++)
429 MSGLOG(
"Message.resizeData(%hu): buffer = %p\n", newSize,
m_buffer);
441 "Message.resizeData after realloc(%hu): buffer = %p\n",
m_maxLength,
542 m_checksum[0] += dest[0] + dest[1] + dest[2] + dest[3] + dest[4] +
543 dest[5] + dest[6] + dest[7] - cdata[0] - cdata[1] -
544 cdata[2] - cdata[3] - cdata[4] - cdata[5] - cdata[6] -
567 m_checksum[0] += dest[0] + dest[1] + dest[2] + dest[3] - cdata[0] -
568 cdata[1] - cdata[2] - cdata[3];
595 int32_t dexp = ((fp.
i32.
i0 & (0x7fffffffL)) >> 20) - 1023;
605 fp.
i64 = fp.
i64 >> (20 - dexp);
663 for (
uint16_t i = 0; i < numValues; i++)
698 dest[0] + dest[1] + dest[2] + dest[3] - (
data & 0xFF) -
699 ((
data >> 8) & 0xFF) - ((
data >> 16) & 0xFF) -
700 ((
data >> 24) & 0xFF));
754 if (
size == 0)
return;
757 if (
offset >= oldSize)
return;
760 newSize = oldSize -
size;
777 if (
size == 0)
return;
#define CMT_OUTPUTSETTINGS_DATAFORMAT_FLOAT
uint32_t getDataLong(const uint16_t offset=0) const
Return the current value of the data as an uint32_t (32 bits).
Operation was performed successfully.
double getDataFPValue(const uint64_t outputSettings, const uint16_t offset=0) const
Return current data value as double, conversion depends on outputSettings.
GLuint GLuint GLsizei count
void setDataFPValue(const uint64_t outputSettings, const double data, const uint16_t offset=0)
Write a floating/fixed point value into to the data buffer, conversion depends on outputSettings...
#define CMT_OUTPUTSETTINGS_DATAFORMAT_FP1632
unsigned __int16 uint16_t
uint8_t * getDataStart(void) const
Internal function to get the start of the data buffer.
void resizeData(const uint16_t newSize)
Resize the data area to the given size.
void operator=(const Message &src)
Copy message src into this.
double getDataFP1632(const uint16_t offset=0) const
Return the current value of the data as a double, converting it from FP 16.32.
void deleteData(uint16_t size, uint16_t offset=0)
Remove a number of bytes from the message (this will reduce the message size)
double getDataF1220(const uint16_t offset=0) const
Return the current value of the data as a double, converting it from FP 12.20.
void clear(void)
Clear all data in the message.
uint16_t getDataSize(void) const
Return the length of the data part of the message.
void insertData(uint16_t size, uint16_t offset=0)
Insert a number of bytes into the message (this will increase the message size)
#define CMT_OUTPUTSETTINGS_DATAFORMAT_DOUBLE
uint16_t getDataShort(const uint16_t offset=0) const
Return the current value of the data as an uint16_t (16 bits).
void recomputeChecksum(void)
Compute the checksum field and fill it.
#define CMT_LEN_MSGEXTHEADER
Message(const uint8_t msgId=0, const uint16_t length=0, const uint16_t maxLength=CMT_MAXMSGLEN)
Create a Message object with the given data length and message Id.
CMT_CHECKVAR MessageHeader * m_buffer
The message header is the data buffer with interpretation.
uint8_t computeChecksum(const uint8_t *buffer, uint32_t length)
Compute the checksum of the given byte string.
float getDataFloat(const uint16_t offset=0) const
Return the current value of the data as a float (32 bits).
struct xsens::Itypes::@92 f32
XsensResultValue
Xsens return values.
#define CMT_LEN_MSGEXTHEADERCS
void setDataFloat(const float data, const uint16_t offset=0)
Write a float (32 bits) into the data buffer.
XsensResultValue loadFromString(const uint8_t *source, const uint16_t size)
Read the entire message from the given source string.
#define CMT_OUTPUTSETTINGS_DATAFORMAT_MASK
void setDataLong(const uint32_t data, const uint16_t offset=0)
Write an uint32_t (32 bits) into the data buffer.
struct xsens::Itypes::@89 i32
void setDataDouble(const double data, const uint16_t offset=0)
Write a double (64 bits) into the data buffer.
uint8_t * getDataBuffer(const uint16_t offset=0)
Return a pointer to the data buffer.
unsigned __int64 uint64_t
struct xsens::Itypes::@91 i8
#define CMT_OUTPUTSETTINGS_DATAFORMAT_F1220
void setDataFP1632(const double data, const uint16_t offset=0)
Write a double (64 bits) into the data buffer, after converting it to FP1632.
uint8_t calcChecksum(void) const
Internal checksum computation.
#define CMT_LEN_MSGHEADERCS
GLuint GLsizei GLsizei * length
GLsizei GLsizei GLchar * source
struct xsens::Itypes::@90 i16
The namespace of all Xsens software since 2006.
void setDataBuffer(const uint8_t *data, const uint16_t offset=0, const uint16_t count=0)
Write a string of bytes into the data buffer.
#define CMT_LEN_MSGHEADER
void setMessageId(const uint8_t msgId)
Set the new value of the m_messageId field and update the checksum.
void setBusId(const uint8_t busId)
Set the new value of the m_busId field and update the checksum.
bool m_autoUpdateChecksum
uint16_t getTotalMessageSize(void) const
Return the length of the message buffer.
unsigned __int32 uint32_t
bool isChecksumOk(void) const
Compute the checksum and compare it with the stored checksum.
uint8_t * m_checksum
The checksum in the m_data or m_extendedData buffer.
GLsizei GLsizei GLenum GLenum const GLvoid * data
double getDataDouble(const uint16_t offset=0) const
Return the current value of the data as a double (64 bits).
void setDataF1220(const double data, const uint16_t offset=0)
Write a double (64 bits) into the data buffer, after converting it to F1220.
void setDataByte(const uint8_t data, const uint16_t offset=0)
Write an unsigned byte (8 bits) into the data buffer.
uint32_t m_maxLength
The maximum size of the message, including header and footer.
Class for storing a single message.
void memcpy(void *dest, size_t destSize, const void *src, size_t copyCount) noexcept
An OS and compiler independent version of "memcpy".
void setDataShort(const uint16_t data, const uint16_t offset=0)
Write an uint16_t (16 bits) into the data buffer.