Class for storing a single message.
Definition at line 83 of file cmtmessage.h.
#include <xSens_MT3/cmtmessage.h>
Public Member Functions | |
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. More... | |
Message (const uint8_t *source, const uint16_t size, const uint16_t maxLength=CMT_MAXMSGLEN) | |
Create a message from the given source string. More... | |
Message (const Message &src) | |
~Message () | |
Destructor. More... | |
void | clear (void) |
Clear all data in the message. More... | |
uint8_t | getBusId (void) const |
Return the current value of the m_busId field. More... | |
uint8_t * | getDataBuffer (const uint16_t offset=0) |
Return a pointer to the data buffer. More... | |
const uint8_t * | getDataBuffer (const uint16_t offset=0) const |
uint8_t | getDataByte (const uint16_t offset=0) const |
Return the current value of the data as an unsigned byte (8 bits). More... | |
double | getDataDouble (const uint16_t offset=0) const |
Return the current value of the data as a double (64 bits). More... | |
float | getDataFloat (const uint16_t offset=0) const |
Return the current value of the data as a float (32 bits). More... | |
double | getDataF1220 (const uint16_t offset=0) const |
Return the current value of the data as a double, converting it from FP 12.20. More... | |
double | getDataFP1632 (const uint16_t offset=0) const |
Return the current value of the data as a double, converting it from FP 16.32. More... | |
double | getDataFPValue (const uint64_t outputSettings, const uint16_t offset=0) const |
Return current data value as double, conversion depends on outputSettings. More... | |
void | getDataFPValue (double *dest, const uint64_t outputSettings, uint16_t offset, const int16_t numValues) const |
Return current data values as double, conversion depends on outputSetting. More... | |
uint32_t | getDataLong (const uint16_t offset=0) const |
Return the current value of the data as an uint32_t (32 bits). More... | |
uint16_t | getDataShort (const uint16_t offset=0) const |
Return the current value of the data as an uint16_t (16 bits). More... | |
uint16_t | getDataSize (void) const |
Return the length of the data part of the message. More... | |
uint8_t | getMessageId (void) const |
Return the current value of the m_messageId field. More... | |
const uint8_t * | getMessageStart (void) const |
Return the start of the message buffer. More... | |
uint16_t | getTotalMessageSize (void) const |
Return the length of the message buffer. More... | |
bool | isChecksumOk (void) const |
Compute the checksum and compare it with the stored checksum. More... | |
XsensResultValue | loadFromString (const uint8_t *source, const uint16_t size) |
Read the entire message from the given source string. More... | |
void | recomputeChecksum (void) |
Compute the checksum field and fill it. More... | |
void | resizeData (const uint16_t newSize) |
Resize the data area to the given size. More... | |
void | setBusId (const uint8_t busId) |
Set the new value of the m_busId field and update the checksum. More... | |
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. More... | |
void | setDataByte (const uint8_t data, const uint16_t offset=0) |
Write an unsigned byte (8 bits) into the data buffer. More... | |
void | setDataDouble (const double data, const uint16_t offset=0) |
Write a double (64 bits) into the data buffer. More... | |
void | setDataFloat (const float data, const uint16_t offset=0) |
Write a float (32 bits) into the data buffer. More... | |
void | setDataF1220 (const double data, const uint16_t offset=0) |
Write a double (64 bits) into the data buffer, after converting it to F1220. More... | |
void | setDataFP1632 (const double data, const uint16_t offset=0) |
Write a double (64 bits) into the data buffer, after converting it to FP1632. More... | |
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. More... | |
void | setDataFPValue (const uint64_t outputSettings, const double *data, uint16_t offset, const uint16_t numValues) |
Write a floating/fixed point value into to the data buffer, conversion depends on outputSettings. More... | |
void | setDataLong (const uint32_t data, const uint16_t offset=0) |
Write an uint32_t (32 bits) into the data buffer. More... | |
void | setDataShort (const uint16_t data, const uint16_t offset=0) |
Write an uint16_t (16 bits) into the data buffer. More... | |
void | setMessageId (const uint8_t msgId) |
Set the new value of the m_messageId field and update the checksum. More... | |
void | operator= (const Message &src) |
Copy message src into this. More... | |
void | deleteData (uint16_t size, uint16_t offset=0) |
Remove a number of bytes from the message (this will reduce the message size) More... | |
void | insertData (uint16_t size, uint16_t offset=0) |
Insert a number of bytes into the message (this will increase the message size) More... | |
Public Attributes | |
bool | m_autoUpdateChecksum |
Protected Member Functions | |
uint8_t | calcChecksum (void) const |
Internal checksum computation. More... | |
uint8_t * | getDataStart (void) const |
Internal function to get the start of the data buffer. More... | |
Protected Attributes | |
CMT_CHECKVAR MessageHeader * | m_buffer |
The message header is the data buffer with interpretation. More... | |
uint8_t * | m_checksum |
The checksum in the m_data or m_extendedData buffer. More... | |
uint32_t | m_maxLength |
The maximum size of the message, including header and footer. More... | |
xsens::Message::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.
The function allocates enough memory to hold an entire message with the
given data length.
msgId | The message Id that will be assigend to the m_messageId field. |
length | The length of the data in the message. This value is stored in m_createdLength as well as m_length or m_extendedLength . |
maxLength | The maximum data length that can be stored in the structure. |
Definition at line 41 of file cmtmessage.cpp.
References CMT_BID_MASTER, CMT_CHECKASSIGN, CMT_EXTLENCODE, CMT_LEN_MSGEXTHEADER, CMT_LEN_MSGHEADER, CMT_MAXMSGLEN, CMT_PREAMBLE, m_autoUpdateChecksum, m_buffer, xsens::MessageHeader::m_busId, m_checksum, xsens::MessageHeader::m_datlen, xsens::MessageHeader::_mdl::m_extended, xsens::MessageHeader::_mdl::_mextd::_mlen::m_high, xsens::MessageHeader::m_length, xsens::MessageHeader::_mdl::_mextd::m_length, xsens::MessageHeader::_mdl::_mextd::_mlen::m_low, m_maxLength, xsens::MessageHeader::m_messageId, xsens::MessageHeader::m_preamble, and MSGLOG.
xsens::Message::Message | ( | const uint8_t * | source, |
const uint16_t | size, | ||
const uint16_t | maxLength = CMT_MAXMSGLEN |
||
) |
Create a message from the given source string.
This is done through a simple memory copy. The number of bytes copied is
taken from the data in the message (so the message is interpreted first). Note that this does NOT recompute the checksum, nor is it checked.
source | The source string containing message data |
size | The size of the source string |
maxLength | The maximum data length that can be stored in the structure. |
Definition at line 85 of file cmtmessage.cpp.
References CMT_CHECKASSIGN, CMT_EXTLENCODE, CMT_LEN_MSGEXTHEADERCS, CMT_LEN_MSGHEADERCS, CMT_MAXMSGLEN, m_autoUpdateChecksum, m_buffer, m_checksum, m_maxLength, mrpt::system::os::memcpy(), and MSGLOG.
xsens::Message::Message | ( | const Message & | src | ) |
Definition at line 124 of file cmtmessage.cpp.
References CMT_CHECKASSIGN, m_autoUpdateChecksum, m_buffer, m_checksum, m_maxLength, and mrpt::system::os::memcpy().
xsens::Message::~Message | ( | ) |
Destructor.
Definition at line 138 of file cmtmessage.cpp.
References CMT_CHECKASSERT, m_buffer, and MSGLOG.
Internal checksum computation.
Definition at line 96 of file cmtmessage.h.
References xsens::computeChecksum(), getTotalMessageSize(), and m_buffer.
Referenced by isChecksumOk(), loadFromString(), and recomputeChecksum().
Clear all data in the message.
Definition at line 147 of file cmtmessage.cpp.
References CMT_BID_MASTER, CMT_CHECKASSERT, CMT_LEN_MSGHEADER, CMT_PREAMBLE, m_buffer, xsens::MessageHeader::m_busId, m_checksum, m_maxLength, and xsens::MessageHeader::m_preamble.
Referenced by xsens::Cmt2f::readMessage(), and xsens::Cmt2s::waitForMessage().
Remove a number of bytes from the message (this will reduce the message size)
Definition at line 752 of file cmtmessage.cpp.
References getDataBuffer(), getDataSize(), and resizeData().
Referenced by xsens::Packet::setXbus().
Return the current value of the m_busId field.
Definition at line 151 of file cmtmessage.h.
References m_buffer, and xsens::MessageHeader::m_busId.
Return a pointer to the data buffer.
\param offset An optional offset in the data buffer from where to start
reading.
Definition at line 157 of file cmtmessage.h.
References getDataStart().
Referenced by deleteData(), xsens::Cmt3::getAvailableScenarios(), xsens::Cmt3::getConfiguration(), xsens::Cmt3::getEMtsData(), xsens::Cmt3::getProductCode(), xsens::Packet::getRawData(), insertData(), and CmtDeviceConfiguration::readFromMessage().
Definition at line 161 of file cmtmessage.h.
References getDataStart().
Return the current value of the data as an unsigned byte (8 bits).
\param offset An optional offset in the data buffer from where to start
reading.
Definition at line 171 of file cmtmessage.h.
References getDataStart().
Referenced by xsens::Cmt3::getAvailableScenarios(), xsens::Cmt3::getEMtsData(), xsens::Cmt3::getFirmwareRevision(), xsens::Cmt3::getGpsStatus(), xsens::Packet::getRawGpsData(), xsens::Cmt3::getScenario(), xsens::Cmt3::getSerialBaudrate(), xsens::Packet::getStatus(), xsens::Cmt3::getSyncMode(), xsens::Cmt3::getUtcTime(), xsens::Cmt3::getXmOutputMode(), xsens::Cmt3::gotoConfig(), xsens::Cmt3::readDataPacket(), xsens::Cmt3::setGpsLeverArm(), xsens::Cmt3::storeXkfState(), and xsens::Cmt3::waitForDataMessage().
double xsens::Message::getDataDouble | ( | const uint16_t | offset = 0 | ) | const |
Return the current value of the data as a double (64 bits).
\param offset An optional offset in the data buffer from where to start
reading.
Definition at line 160 of file cmtmessage.cpp.
References CMT_CHECKASSERT, and getDataStart().
Referenced by getDataFPValue().
double xsens::Message::getDataF1220 | ( | const uint16_t | offset = 0 | ) | const |
Return the current value of the data as a double, converting it from FP 12.20.
\param offset An optional offset in the data buffer from where to start
reading.
Definition at line 197 of file cmtmessage.cpp.
References CMT_CHECKASSERT, and getDataStart().
Referenced by getDataFPValue().
float xsens::Message::getDataFloat | ( | const uint16_t | offset = 0 | ) | const |
Return the current value of the data as a float (32 bits).
\param offset An optional offset in the data buffer from where to start
reading.
Definition at line 180 of file cmtmessage.cpp.
References CMT_CHECKASSERT, and getDataStart().
Referenced by getDataFPValue(), xsens::Cmt3::getGpsLeverArm(), xsens::Cmt3::getGravityMagnitude(), xsens::Cmt3::getHeading(), and xsens::Cmt3::getMagneticDeclination().
double xsens::Message::getDataFP1632 | ( | const uint16_t | offset = 0 | ) | const |
Return the current value of the data as a double, converting it from FP 16.32.
\param offset An optional offset in the data buffer from where to start
reading.
Definition at line 239 of file cmtmessage.cpp.
References CMT_CHECKASSERT, getDataStart(), xsens::Itypes::i0, xsens::Itypes::i1, xsens::Itypes::i32, and xsens::Itypes::i64.
Referenced by getDataFPValue().
double xsens::Message::getDataFPValue | ( | const uint64_t | outputSettings, |
const uint16_t | offset = 0 |
||
) | const |
Return current data value as double, conversion depends on outputSettings.
\param outputSettings MT output settings \param offset An optional offset in the data buffer from where to start
reading.
Definition at line 267 of file cmtmessage.cpp.
References CMT_OUTPUTSETTINGS_DATAFORMAT_DOUBLE, CMT_OUTPUTSETTINGS_DATAFORMAT_F1220, CMT_OUTPUTSETTINGS_DATAFORMAT_FLOAT, CMT_OUTPUTSETTINGS_DATAFORMAT_FP1632, CMT_OUTPUTSETTINGS_DATAFORMAT_MASK, getDataDouble(), getDataF1220(), getDataFloat(), and getDataFP1632().
Referenced by xsens::Packet::getAccG(), xsens::Packet::getCalAcc(), xsens::Packet::getCalData(), xsens::Packet::getCalGyr(), xsens::Packet::getCalMag(), xsens::Packet::getOriEuler(), xsens::Packet::getOriMatrix(), xsens::Packet::getOriQuat(), xsens::Packet::getPositionLLA(), xsens::Packet::getTemp(), and xsens::Packet::getVelocity().
void xsens::Message::getDataFPValue | ( | double * | dest, |
const uint64_t | outputSettings, | ||
uint16_t | offset, | ||
const int16_t | numValues | ||
) | const |
Return current data values as double, conversion depends on outputSetting.
\param dest destination array \param outputSettings MT output settings \param offset offset in the data buffer from where to start reading. \param numValues number of values to be read
Definition at line 290 of file cmtmessage.cpp.
References CMT_OUTPUTSETTINGS_DATAFORMAT_DOUBLE, CMT_OUTPUTSETTINGS_DATAFORMAT_F1220, CMT_OUTPUTSETTINGS_DATAFORMAT_FLOAT, CMT_OUTPUTSETTINGS_DATAFORMAT_FP1632, CMT_OUTPUTSETTINGS_DATAFORMAT_MASK, getDataDouble(), getDataF1220(), getDataFloat(), and getDataFP1632().
Return the current value of the data as an uint32_t (32 bits).
\param offset An optional offset in the data buffer from where to start
reading.
Definition at line 322 of file cmtmessage.cpp.
References CMT_CHECKASSERT, and getDataStart().
Referenced by xsens::Packet::getRawGpsData(), xsens::Cmt3::getSyncInOffset(), xsens::Cmt3::getSyncInSettings(), xsens::Cmt3::getSyncOutOffset(), xsens::Cmt3::getSyncOutPulseWidth(), xsens::Cmt3::getSyncOutSettings(), xsens::Cmt3::getUtcTime(), and CmtDeviceConfiguration::readFromMessage().
Return the current value of the data as an uint16_t (16 bits).
\param offset An optional offset in the data buffer from where to start
reading.
Definition at line 338 of file cmtmessage.cpp.
References CMT_CHECKASSERT, and getDataStart().
Referenced by xsens::Packet::getAnalogIn1(), xsens::Packet::getAnalogIn2(), xsens::Cmt3::getLocationId(), xsens::Packet::getRawAcc(), xsens::Packet::getRawGpsData(), xsens::Packet::getRawGyr(), xsens::Packet::getRawMag(), xsens::Packet::getRawTemp(), xsens::Packet::getSampleCounter(), xsens::Cmt3::getSyncInMode(), xsens::Cmt3::getSyncInSettings(), xsens::Cmt3::getSyncInSkipFactor(), xsens::Cmt3::getSyncOutMode(), xsens::Cmt3::getSyncOutSettings(), xsens::Cmt3::getSyncOutSkipFactor(), xsens::Cmt3::getUtcTime(), and CmtDeviceConfiguration::readFromMessage().
Return the length of the data part of the message.
Definition at line 352 of file cmtmessage.cpp.
References CMT_CHECKASSERT, m_buffer, xsens::MessageHeader::m_datlen, xsens::MessageHeader::_mdl::m_extended, xsens::MessageHeader::_mdl::_mextd::_mlen::m_high, xsens::MessageHeader::m_length, xsens::MessageHeader::_mdl::_mextd::m_length, and xsens::MessageHeader::_mdl::_mextd::_mlen::m_low.
Referenced by deleteData(), xsens::Cmt3::getEMtsData(), xsens::Cmt3::getProductCode(), xsens::Cmt3::gotoConfig(), insertData(), xsens::Cmt3::readDataPacket(), setDataBuffer(), setDataByte(), setDataDouble(), setDataFloat(), setDataFP1632(), setDataLong(), setDataShort(), xsens::Cmt3::setGpsLeverArm(), xsens::Cmt3::storeXkfState(), xsens::Packet::updateAccG(), xsens::Packet::updateAnalogIn1(), xsens::Packet::updateAnalogIn2(), xsens::Packet::updateCalAcc(), xsens::Packet::updateCalData(), xsens::Packet::updateCalGyr(), xsens::Packet::updateCalMag(), xsens::Packet::updateOriEuler(), xsens::Packet::updateOriMatrix(), xsens::Packet::updateOriQuat(), xsens::Packet::updatePositionLLA(), xsens::Packet::updateRawAcc(), xsens::Packet::updateRawData(), xsens::Packet::updateRawGpsData(), xsens::Packet::updateRawGyr(), xsens::Packet::updateRawMag(), xsens::Packet::updateRawTemp(), xsens::Packet::updateSampleCounter(), xsens::Packet::updateStatus(), xsens::Packet::updateTemp(), xsens::Packet::updateVelocity(), and xsens::Cmt3::waitForDataMessage().
Internal function to get the start of the data buffer.
Definition at line 365 of file cmtmessage.cpp.
References CMT_CHECKASSERT, m_buffer, xsens::MessageHeader::_mdl::_mextd::m_data, xsens::MessageHeader::_mdl::m_data, xsens::MessageHeader::m_datlen, xsens::MessageHeader::_mdl::m_extended, and xsens::MessageHeader::m_length.
Referenced by getDataBuffer(), getDataByte(), getDataDouble(), getDataF1220(), getDataFloat(), getDataFP1632(), getDataLong(), getDataShort(), setDataBuffer(), setDataByte(), setDataDouble(), setDataFloat(), setDataFP1632(), setDataLong(), and setDataShort().
Return the current value of the m_messageId field.
Definition at line 236 of file cmtmessage.h.
References m_buffer, and xsens::MessageHeader::m_messageId.
Referenced by xsens::Cmt3::getEMtsData(), xsens::Cmt3::gotoConfig(), xsens::Cmt3::peekLogMessageId(), xsens::Cmt3::readDataPacket(), xsens::Cmt2f::readMessage(), xsens::Cmt3::setGpsLeverArm(), xsens::Cmt3::storeXkfState(), xsens::Cmt3::waitForDataMessage(), and xsens::Cmt2s::waitForMessage().
Return the start of the message buffer.
The function returns the address of the \c m_preamble member.
Definition at line 241 of file cmtmessage.h.
References m_buffer.
Referenced by xsens::Cmt2s::readMessage(), xsens::Cmt3::refreshCache(), xsens::Cmt2s::writeMessage(), and xsens::Cmt2f::writeMessage().
Return the length of the message buffer.
The function returns the total size of the message, including the
checksum. This is in effect the number of bytes that would be transferred if the message were to be sent over a communications channel.
Definition at line 378 of file cmtmessage.cpp.
References CMT_CHECKASSERT, CMT_LEN_MSGEXTHEADERCS, CMT_LEN_MSGHEADERCS, m_buffer, xsens::MessageHeader::m_datlen, xsens::MessageHeader::_mdl::m_extended, xsens::MessageHeader::_mdl::_mextd::_mlen::m_high, xsens::MessageHeader::m_length, xsens::MessageHeader::_mdl::_mextd::m_length, and xsens::MessageHeader::_mdl::_mextd::_mlen::m_low.
Referenced by calcChecksum(), isChecksumOk(), xsens::Cmt2s::writeMessage(), and xsens::Cmt2f::writeMessage().
Insert a number of bytes into the message (this will increase the message size)
Definition at line 775 of file cmtmessage.cpp.
References getDataBuffer(), getDataSize(), and resizeData().
Referenced by xsens::Packet::setXbus().
bool xsens::Message::isChecksumOk | ( | void | ) | const |
Compute the checksum and compare it with the stored checksum.
Equal is ok.
Definition at line 390 of file cmtmessage.cpp.
References calcChecksum(), getTotalMessageSize(), m_checksum, and m_maxLength.
Referenced by xsens::findValidMessage().
XsensResultValue xsens::Message::loadFromString | ( | const uint8_t * | source, |
const uint16_t | size | ||
) |
Read the entire message from the given source string.
This is done through a simple memory copy. The number of bytes copied is
m_createdLength
.
source | The source string containing message data |
size | The size of the source string |
Definition at line 398 of file cmtmessage.cpp.
References calcChecksum(), CMT_CHECKASSERT, CMT_EXTLENCODE, CMT_LEN_MSGEXTHEADERCS, CMT_LEN_MSGHEADERCS, m_buffer, m_checksum, xsens::MessageHeader::m_datlen, xsens::MessageHeader::_mdl::m_extended, xsens::MessageHeader::_mdl::_mextd::_mlen::m_high, xsens::MessageHeader::m_length, xsens::MessageHeader::_mdl::_mextd::m_length, xsens::MessageHeader::_mdl::_mextd::_mlen::m_low, m_maxLength, mrpt::system::os::memcpy(), XRV_CHECKSUMFAULT, XRV_DATACORRUPT, XRV_OK, and XRV_PARAMINVALID.
Referenced by xsens::Cmt2s::readMessage(), xsens::Cmt2f::readMessage(), and xsens::Cmt2s::waitForMessage().
Copy message src into this.
Definition at line 735 of file cmtmessage.cpp.
References CMT_CHECKASSERT, m_buffer, m_checksum, m_maxLength, and mrpt::system::os::memcpy().
Compute the checksum field and fill it.
The checksum field should normally be correct at all times, but if you
have somehow managed to mess it up, this function can be used to recompute it.
Definition at line 270 of file cmtmessage.h.
References calcChecksum(), and m_checksum.
Referenced by xsens::Cmt3::getConfiguration(), and resizeData().
Resize the data area to the given size.
Definition at line 424 of file cmtmessage.cpp.
References CMT_CHECKASSERT, CMT_EXTLENCODE, CMT_LEN_MSGEXTHEADERCS, m_autoUpdateChecksum, m_buffer, m_checksum, xsens::MessageHeader::_mdl::_mextd::m_data, xsens::MessageHeader::_mdl::m_data, xsens::MessageHeader::m_datlen, xsens::MessageHeader::_mdl::m_extended, xsens::MessageHeader::_mdl::_mextd::_mlen::m_high, xsens::MessageHeader::m_length, xsens::MessageHeader::_mdl::_mextd::m_length, xsens::MessageHeader::_mdl::_mextd::_mlen::m_low, m_maxLength, MSGLOG, and recomputeChecksum().
Referenced by deleteData(), insertData(), setDataBuffer(), setDataByte(), setDataDouble(), setDataFloat(), setDataFP1632(), setDataLong(), setDataShort(), xsens::Cmt3::setDeviceMode2(), xsens::Packet::updateAccG(), xsens::Packet::updateAnalogIn1(), xsens::Packet::updateAnalogIn2(), xsens::Packet::updateCalAcc(), xsens::Packet::updateCalData(), xsens::Packet::updateCalGyr(), xsens::Packet::updateCalMag(), xsens::Packet::updateOriEuler(), xsens::Packet::updateOriMatrix(), xsens::Packet::updateOriQuat(), xsens::Packet::updatePositionLLA(), xsens::Packet::updateRawAcc(), xsens::Packet::updateRawData(), xsens::Packet::updateRawGpsData(), xsens::Packet::updateRawGyr(), xsens::Packet::updateRawMag(), xsens::Packet::updateRawTemp(), xsens::Packet::updateSampleCounter(), xsens::Packet::updateStatus(), xsens::Packet::updateTemp(), and xsens::Packet::updateVelocity().
Set the new value of the m_busId field and update the checksum.
Definition at line 496 of file cmtmessage.cpp.
References CMT_CHECKASSERT, m_autoUpdateChecksum, m_buffer, xsens::MessageHeader::m_busId, and m_checksum.
Referenced by xsens::Cmt3::getConfiguration(), xsens::Cmt3::getEMtsData(), xsens::Cmt3::getSyncInMode(), xsens::Cmt3::getSyncInOffset(), xsens::Cmt3::getSyncInSettings(), xsens::Cmt3::getSyncInSkipFactor(), xsens::Cmt3::getSyncOutMode(), xsens::Cmt3::getSyncOutOffset(), xsens::Cmt3::getSyncOutPulseWidth(), xsens::Cmt3::getSyncOutSettings(), xsens::Cmt3::getSyncOutSkipFactor(), xsens::Cmt3::gotoConfig(), xsens::Cmt3::gotoMeasurement(), xsens::Cmt3::reset(), xsens::Cmt3::setBaudrate(), xsens::Cmt3::setDeviceMode2(), xsens::Cmt3::setGpsLeverArm(), xsens::Cmt3::setSyncInMode(), xsens::Cmt3::setSyncInOffset(), xsens::Cmt3::setSyncInSettings(), xsens::Cmt3::setSyncInSkipFactor(), xsens::Cmt3::setSyncOutMode(), xsens::Cmt3::setSyncOutOffset(), xsens::Cmt3::setSyncOutPulseWidth(), xsens::Cmt3::setSyncOutSettings(), xsens::Cmt3::setSyncOutSkipFactor(), xsens::Cmt3::setXmPowerOff(), and xsens::Cmt3::storeXkfState().
void xsens::Message::setDataBuffer | ( | const uint8_t * | data, |
const uint16_t | offset = 0 , |
||
const uint16_t | count = 0 |
||
) |
Write a string of bytes into the data buffer.
\param data The data to write to the buffer. \param offset An optional offset in the data buffer from where to
start writing.
count | An optional number of bytes to write, if set to 0 (not set), as many bytes as will fit into the buffer from the given point will be written. |
Definition at line 505 of file cmtmessage.cpp.
References CMT_CHECKASSERT, getDataSize(), getDataStart(), m_autoUpdateChecksum, m_checksum, and resizeData().
Referenced by xsens::Cmt3::getEMtsData().
Write an unsigned byte (8 bits) into the data buffer.
\param data The data to write to the buffer. \param offset An optional offset in the data buffer from where to
start writing.
Definition at line 523 of file cmtmessage.cpp.
References CMT_CHECKASSERT, getDataSize(), getDataStart(), m_autoUpdateChecksum, m_checksum, and resizeData().
Referenced by xsens::Cmt3::getEMtsData(), xsens::Cmt3::getSyncInMode(), xsens::Cmt3::getSyncInOffset(), xsens::Cmt3::getSyncInSettings(), xsens::Cmt3::getSyncInSkipFactor(), xsens::Cmt3::getSyncOutMode(), xsens::Cmt3::getSyncOutOffset(), xsens::Cmt3::getSyncOutPulseWidth(), xsens::Cmt3::getSyncOutSettings(), xsens::Cmt3::getSyncOutSkipFactor(), xsens::Cmt3::setSyncInMode(), xsens::Cmt3::setSyncInOffset(), xsens::Cmt3::setSyncInSettings(), xsens::Cmt3::setSyncInSkipFactor(), xsens::Cmt3::setSyncOutMode(), xsens::Cmt3::setSyncOutOffset(), xsens::Cmt3::setSyncOutPulseWidth(), xsens::Cmt3::setSyncOutSettings(), xsens::Cmt3::setSyncOutSkipFactor(), xsens::Packet::updateRawGpsData(), and xsens::Packet::updateStatus().
Write a double (64 bits) into the data buffer.
\param data The data to write to the buffer. \param offset An optional offset in the data buffer from where to start
writing.
Definition at line 534 of file cmtmessage.cpp.
References CMT_CHECKASSERT, getDataSize(), getDataStart(), m_autoUpdateChecksum, m_checksum, and resizeData().
Referenced by setDataFPValue().
Write a double (64 bits) into the data buffer, after converting it to F1220.
\param data The data to write to the buffer. \param offset An optional offset in the data buffer from where to
start writing.
Definition at line 578 of file cmtmessage.cpp.
References setDataLong(), and val.
Referenced by setDataFPValue().
Write a float (32 bits) into the data buffer.
\param data The data to write to the buffer. \param offset An optional offset in the data buffer from where to start
writing.
Definition at line 559 of file cmtmessage.cpp.
References CMT_CHECKASSERT, getDataSize(), getDataStart(), m_autoUpdateChecksum, m_checksum, and resizeData().
Referenced by setDataFPValue(), and xsens::Cmt3::setGpsLeverArm().
Write a double (64 bits) into the data buffer, after converting it to FP1632.
\param data The data to write to the buffer. \param offset An optional offset in the data buffer from where to
start writing.
Definition at line 587 of file cmtmessage.cpp.
References CMT_CHECKASSERT, xsens::Itypes::d, getDataSize(), getDataStart(), xsens::Itypes::i0, xsens::Itypes::i1, xsens::Itypes::i16, xsens::Itypes::i32, xsens::Itypes::i64, resizeData(), xsens::Itypes::s0, and xsens::Itypes::s1.
Referenced by setDataFPValue().
void xsens::Message::setDataFPValue | ( | const uint64_t | outputSettings, |
const double * | data, | ||
uint16_t | offset, | ||
const uint16_t | numValues | ||
) |
Write a floating/fixed point value into to the data buffer, conversion depends on outputSettings.
\param outputSettings MT output settings \param data The data array to be written to the buffer. \param offset Offset in the data buffer from where to start writing. \param numValues number of values to be written
Definition at line 659 of file cmtmessage.cpp.
References CMT_OUTPUTSETTINGS_DATAFORMAT_DOUBLE, CMT_OUTPUTSETTINGS_DATAFORMAT_F1220, CMT_OUTPUTSETTINGS_DATAFORMAT_FLOAT, CMT_OUTPUTSETTINGS_DATAFORMAT_FP1632, CMT_OUTPUTSETTINGS_DATAFORMAT_MASK, setDataDouble(), setDataF1220(), setDataFloat(), and setDataFP1632().
void xsens::Message::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.
\param outputSettings MT output settings \param data The data to write to the buffer. \param offset An optional offset in the data buffer from where to start
writing.
Definition at line 639 of file cmtmessage.cpp.
References CMT_OUTPUTSETTINGS_DATAFORMAT_DOUBLE, CMT_OUTPUTSETTINGS_DATAFORMAT_F1220, CMT_OUTPUTSETTINGS_DATAFORMAT_FLOAT, CMT_OUTPUTSETTINGS_DATAFORMAT_FP1632, CMT_OUTPUTSETTINGS_DATAFORMAT_MASK, setDataDouble(), setDataF1220(), setDataFloat(), and setDataFP1632().
Referenced by xsens::Packet::updateAccG(), xsens::Packet::updateCalAcc(), xsens::Packet::updateCalData(), xsens::Packet::updateCalGyr(), xsens::Packet::updateCalMag(), xsens::Packet::updateOriEuler(), xsens::Packet::updateOriMatrix(), xsens::Packet::updateOriQuat(), xsens::Packet::updatePositionLLA(), xsens::Packet::updateTemp(), and xsens::Packet::updateVelocity().
Write an uint32_t (32 bits) into the data buffer.
\param data The data to write to the buffer. \param offset An optional offset in the data buffer from where to start
writing.
Definition at line 690 of file cmtmessage.cpp.
References CMT_CHECKASSERT, getDataSize(), getDataStart(), m_autoUpdateChecksum, m_checksum, and resizeData().
Referenced by xsens::Cmt3::getConfiguration(), setDataF1220(), xsens::Cmt3::setDeviceMode2(), xsens::Cmt3::setSyncInOffset(), xsens::Cmt3::setSyncInSettings(), xsens::Cmt3::setSyncOutOffset(), xsens::Cmt3::setSyncOutPulseWidth(), xsens::Cmt3::setSyncOutSettings(), and xsens::Packet::updateRawGpsData().
Write an uint16_t (16 bits) into the data buffer.
\param data The data to write to the buffer. \param offset An optional offset in the data buffer from where to start
writing.
Definition at line 710 of file cmtmessage.cpp.
References CMT_CHECKASSERT, getDataSize(), getDataStart(), m_autoUpdateChecksum, m_checksum, and resizeData().
Referenced by xsens::Cmt3::getConfiguration(), xsens::Cmt3::setDeviceMode2(), xsens::Cmt3::setSyncInMode(), xsens::Cmt3::setSyncInSettings(), xsens::Cmt3::setSyncInSkipFactor(), xsens::Cmt3::setSyncOutMode(), xsens::Cmt3::setSyncOutSettings(), xsens::Cmt3::setSyncOutSkipFactor(), xsens::Packet::setXbus(), xsens::Packet::updateAnalogIn1(), xsens::Packet::updateAnalogIn2(), xsens::Packet::updateRawAcc(), xsens::Packet::updateRawData(), xsens::Packet::updateRawGpsData(), xsens::Packet::updateRawGyr(), xsens::Packet::updateRawMag(), xsens::Packet::updateRawTemp(), and xsens::Packet::updateSampleCounter().
Set the new value of the m_messageId field and update the checksum.
Definition at line 726 of file cmtmessage.cpp.
References CMT_CHECKASSERT, m_autoUpdateChecksum, m_buffer, m_checksum, and xsens::MessageHeader::m_messageId.
Referenced by xsens::Cmt3::refreshCache(), and xsens::Cmt3::setDeviceMode2().
bool xsens::Message::m_autoUpdateChecksum |
Definition at line 105 of file cmtmessage.h.
Referenced by Message(), resizeData(), setBusId(), setDataBuffer(), setDataByte(), setDataDouble(), setDataFloat(), setDataLong(), setDataShort(), setMessageId(), and xsens::Packet::updateCalData().
|
protected |
The message header is the data buffer with interpretation.
Definition at line 89 of file cmtmessage.h.
Referenced by calcChecksum(), clear(), getBusId(), getDataSize(), getDataStart(), getMessageId(), getMessageStart(), getTotalMessageSize(), loadFromString(), Message(), operator=(), resizeData(), setBusId(), setMessageId(), and ~Message().
|
protected |
The checksum in the m_data or m_extendedData buffer.
Definition at line 91 of file cmtmessage.h.
Referenced by clear(), isChecksumOk(), loadFromString(), Message(), operator=(), recomputeChecksum(), resizeData(), setBusId(), setDataBuffer(), setDataByte(), setDataDouble(), setDataFloat(), setDataLong(), setDataShort(), and setMessageId().
|
protected |
The maximum size of the message, including header and footer.
Definition at line 93 of file cmtmessage.h.
Referenced by clear(), isChecksumOk(), loadFromString(), Message(), operator=(), and resizeData().
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST |