103 MSGLOG(
"Message(%02x%02x%02x%02x%02x%02x, %hu, %hu): buffer = %p\n",
source[0],
source[1],
source[2],
source[3],
source[4],
source[5],
size,
m_maxLength,
m_buffer);
156 dest[0] =
src[7]; dest[1] =
src[6]; dest[2] =
src[5]; dest[3] =
src[4];
157 dest[4] =
src[3]; dest[5] =
src[2]; dest[6] =
src[1]; dest[7] =
src[0];
192 ret = ((double) tmp)/1048576.0;
239 return (
double) fp.
i64 / 4294967296.0;
269 for (
uint16_t i=0; i<numValues; i++) {
399 MSGLOG(
"Message.resizeData(%hu): buffer = %p\n",newSize,
m_buffer);
513 m_checksum[0] += dest[0] + dest[1] + dest[2] + dest[3]
514 + dest[4] + dest[5] + dest[6] + dest[7]
515 - cdata[0] - cdata[1] - cdata[2] - cdata[3]
516 - cdata[4] - cdata[5] - cdata[6] - cdata[7];
519 dest[0] =
src[7]; dest[1] =
src[6]; dest[2] =
src[5]; dest[3] =
src[4];
520 dest[4] =
src[3]; dest[5] =
src[2]; dest[6] =
src[1]; dest[7] =
src[0];
533 m_checksum[0] += dest[0] + dest[1] + dest[2] + dest[3]
534 - cdata[0] - cdata[1] - cdata[2] - cdata[3];
561 int32_t dexp = ((fp.
i32.
i0 & (0x7fffffffL)) >> 20) - 1023;
572 fp.
i64 = fp.
i64 >> (20-dexp);
627 for (
uint16_t i=0; i<numValues; i++) {
662 ((
data >> 8) & 0xFF) - ((
data >> 16) & 0xFF) - ((
data >> 24) & 0xFF));
726 newSize = oldSize -
size;
void BASE_IMPEXP memcpy(void *dest, size_t destSize, const void *src, size_t copyCount) MRPT_NO_THROWS
An OS and compiler independent version of "memcpy".
#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.
struct xsens::Itypes::@91 i32
struct xsens::Itypes::@94 f32
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)
An invalid parameter is supplied.
#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).
A trusted data stream proves to contain corrupted data.
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.
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
#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
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.
struct xsens::Itypes::@93 i8
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. Equal is ok.
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.
struct xsens::Itypes::@92 i16
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 setDataShort(const uint16_t data, const uint16_t offset=0)
Write an uint16_t (16 bits) into the data buffer.