10 #ifndef _CMT3_H_2006_04_14    11 #define _CMT3_H_2006_04_14    13 #ifndef _CMT_MONOLITHIC   458     bool isXm(
void) 
const;
   461         const char* portName,
   543         const uint32_t baudrate, 
bool reconnect = 
true);
   762         const char* filename, 
bool startLogging = 
false);
   775         const wchar_t* filename, 
bool startLogging = 
false);
   931 #endif  // _CMT3_H_2006_04_14 void fillRtc(Packet *pack)
Internal function to compute the RTC value. 
 
XsensResultValue initBus(void)
Perform an initBus request. 
 
High-level communication class. 
 
A structure for storing the firmware version. 
 
Operation was performed successfully. 
 
CmtDeviceId getMasterId(void)
 
XsensResultValue getSyncOutSkipFactor(uint16_t &skipFactor)
Retrieve the outbound synchronization skip factor of an MT device. 
 
XsensResultValue getSyncMode(uint8_t &mode)
Retrieve the sync mode of the Xbus Master. 
 
XsensResultValue getMagneticDeclination(double &declination, const CmtDeviceId deviceId=CMT_DID_MASTER)
Return the stored magnetic declination. 
 
XsensResultValue getPortNr(uint8_t &port) const
Return the device Id of an MT device. 
 
double m_rtcMsPerSample
ms per sample = 1000 / sample frequency. 
 
XsensResultValue setSyncOutSkipFactor(const uint16_t skipFactor)
Set the outbound synchronization skip factor of an MT device. 
 
uint16_t m_firstItem
The index of the first formatting item. 
 
uint16_t m_skip
The skip factor of the port. 
 
TimeStamp m_rtcStart
The start of the RTC counter, the time of arrival of sample 0. 
 
unsigned __int16 uint16_t
 
Mid-level serial communication class. 
 
XsensResultValue setBusPowerState(const bool enabled)
Switch the Xbus Master bus power on or off. 
 
uint32_t getDeviceCount(void) const
Retrieve total device count. 
 
XsensResultValue getGpsLeverArm(CmtVector &arm, const CmtDeviceId deviceId=CMT_DID_MASTER)
Get the currently used GPS lever arm. 
 
XsensResultValue openPort(const char *portName, const uint32_t baudRate=CMT_DEFAULT_BAUD_RATE)
 
XsensResultValue setSyncOutPulseWidth(const uint32_t pulseWidth)
Set the outbound synchronization pulse width of an MT device. 
 
XsensResultValue getGpsStatus(CmtGpsStatus &status, const CmtDeviceId deviceId=CMT_DID_MASTER)
Request the status of the GPS satellites in orbit. 
 
bool m_readFromFile
Indicates whether to read from the log file or from the serial port. 
 
XsensResultValue refreshCache(const bool file=false)
Update device information stored on host PC. 
 
XsensResultValue getSyncOutPulseWidth(uint32_t &pulseWidth)
Retrieve the outbound synchronization pulse width of an MT device. 
 
XsensResultValue getBatteryLevel(uint8_t &level)
Get an Xbus Master's battery level. 
 
Cmt2f * getCmt2f(void)
Return a reference to the embedded Cmt2f (logfile) object. 
 
XsensResultValue getLogFileReadPosition(CmtFilePos &pos)
Retrieve the read position of the log file. 
 
XsensResultValue getDeviceId(const uint8_t busId, CmtDeviceId &deviceId) const
Retrieve the DeviceId of a device given its Bus ID. 
 
XsensResultValue setDeviceMode(const CmtDeviceMode &mode, bool force, const CmtDeviceId deviceId=CMT_DID_MASTER)
Set the complete output mode of a device. 
 
XsensResultValue readDataPacket(Packet *pack, bool acceptOther=false)
Retrieve a data message. 
 
bool m_logging
Indicates whether to write all received messages to the logfile or not, automatically set to true by ...
 
A structure for storing sync out settings. 
 
XsensResultValue getDeviceMode(CmtDeviceMode &mode, const CmtDeviceId deviceId=CMT_DID_MASTER)
Return device mode. 
 
uint32_t m_rtcCount
The long sample counter (normal counter wraps at 64k). 
 
XsensResultValue restoreFactoryDefaults(const CmtDeviceId deviceId=CMT_DID_MASTER)
Restore the device to factory default settings. 
 
XsensResultValue resetLogFileReadPos(void)
Restart reading from the start of the open log file. 
 
XsensResultValue setSyncInMode(const uint16_t mode)
Set the inbound synchronization mode of an MT device. 
 
XsensResultValue getLocationId(uint16_t &locationId, const CmtDeviceId deviceId=CMT_DID_MASTER)
Return the location ID of a sensor. 
 
bool m_rtcInitialized
Indicates if the rtc is initialised or not. 
 
#define CMT_DEFAULT_BAUD_RATE
The default baud rate of the Cmt1s serial communication. 
 
bool isLogFileOpen(const char *filename) const
Return whether or not(true or false) the supplied file is open. 
 
uint16_t m_gotoConfigTries
The number of times a goto config is attempted before the function fails. 
 
XsensResultValue gotoMeasurement(void)
Place all connected devices into Measurement Mode. 
 
XsensResultValue setTimeout(const uint32_t ms)
Set the default timeout value to use in blocking operations on the communication port. 
 
A structure for storing UTC Time values. 
 
XsensResultValue reset(void)
Request a data. 
 
XsensResultValue getSyncInOffset(uint32_t &offset)
Retrieve the inbound synchronization offset of an MT device. 
 
XsensResultValue getMtDeviceId(const uint8_t index, CmtDeviceId &deviceId) const
 
A structure for storing sync in settings. 
 
XsensResultValue getSyncInSettings(CmtSyncInSettings &settings)
Retrieve the inbound synchronization settings of the master MT device. 
 
XsensResultValue writeMessageToLogFile(const Message &msg)
 
XsensResultValue setErrorMode(const uint16_t mode)
Set the error mode of the device. 
 
uint16_t getMtCount(void) const
Return the device Id of the first. 
 
XsensResultValue setXmPowerOff(void)
Switch the connected Xbus Master. 
 
XsensResultValue setDeviceMode2(const CmtDeviceMode2 &mode, bool force, const CmtDeviceId deviceId=CMT_DID_MASTER)
Set the complete output mode2 of a device. 
 
XsensResultValue getConfiguration(CmtDeviceConfiguration &configuration)
Get device configuration. 
 
XsensResultValue getSyncOutSettings(CmtSyncOutSettings &settings)
Retrieve the outbound synchronization settings of the master MT device. 
 
XsensResultValue getHeading(double &heading, const CmtDeviceId deviceId=CMT_DID_MASTER)
Return the heading offset. 
 
bool isXm(void) const
Return whether the main device is an Xbus Master or not. 
 
A structure containing MT data + timestamp and formatting information. 
 
XsensResultValue closeLogFile(bool del=false)
Close an open log file. 
 
void clearHwError(void)
Reset the hardware error code. 
 
Cmt2s * getCmt2s(void)
Return a reference to the embedded Cmt2s (comm port) object. 
 
XsensResultValue setBaudrate(const uint32_t baudrate, bool reconnect=true)
Set the baudrate and possibly reconnect. 
 
XsensResultValue getAvailableScenarios(CmtScenario *scenarios, const CmtDeviceId deviceId=CMT_DID_MASTER)
Write the specified message to the open. 
 
XsensResultValue getBusId(uint8_t &busId, const CmtDeviceId deviceId=CMT_DID_MASTER) const
Retrieve the BusId of a device. 
 
Cmt3()
Default constructor, initializes all members to their default values. 
 
XsensResultValue setDataSource(bool readFromFile)
Set whether to read from comm port or file. 
 
XsensResultValue setSyncOutSettings(const CmtSyncOutSettings &settings)
Set the outbound synchronization settings of an MT device. 
 
XsensResultValue setMagneticDeclination(const double declination, const CmtDeviceId deviceId=CMT_DID_MASTER)
Set the stored magnetic declination. 
 
uint8_t getBusIdInternal(const CmtDeviceId devId) const
Find a device Id in the list and return its busId. 
 
Structure containing a full device configuration as returned by the ReqConfig message. 
 
XsensResultValue setGpsLeverArm(const CmtVector &arm, const CmtDeviceId deviceId=CMT_DID_MASTER)
Set the currently used GPS lever arm. 
 
XsensResultValue setXmOutputMode(const uint8_t mode)
Set the dual-output mode of the XM. 
 
XsensResultValue requestData(Packet *pack)
 
The mid-level file communication class. 
 
uint32_t m_baudrate
The baudrate that was last set to be used by the port. 
 
XsensResultValue getLogFileName(char *filename)
Retrieve the name of the open log file or an empty string if no logfile is open. 
 
XsensResultValue openLogFile(const char *filename)
Open a log file for input. 
 
bool isLogging(void) const
Return whether the Cmt3 object is writing to a log file or not. 
 
XsensResultValue getErrorMode(uint16_t &mode, const CmtDeviceId deviceId=CMT_DID_MASTER)
Return the error mode of the device. 
 
XsensResultValue setGravityMagnitude(const double magnitude, const CmtDeviceId deviceId=CMT_DID_MASTER)
Set the currently used magnitude of the gravity vector. 
 
XsensResultValue getScenario(uint8_t &scenarioType, uint8_t &scenarioVersion, const CmtDeviceId deviceId=CMT_DID_MASTER)
Get the currently active scenario from a Motion Tracker. 
 
XsensResultValue
Xsens return values. 
 
XsensResultValue createLogFile(const char *filename, bool startLogging=false)
Create a log file for incoming messages. 
 
CmtDeviceId m_lastHwErrorDeviceId
Contains the Device ID of the device that caused the last hardware error. 
 
uint32_t m_timeoutMeas
The measurement mode timeout. 
 
Cmt2s m_serial
The (optional) CMT level 2 serial object that this class operates on. 
 
XsensResultValue getUtcTime(CmtUtcTime &utc, const CmtDeviceId deviceId)
Return the UTC time of the last received sample. 
 
XsensResultValue getSyncInMode(uint16_t &mode)
Retrieve the inbound synchronization mode of an MT device. 
 
uint64_t TimeStamp
A real-time timestamp (ms) 
 
XsensResultValue setSyncOutOffset(const uint32_t offset)
Set the outbound synchronization offset of an MT device. 
 
XsensResultValue getSerialBaudrate(uint32_t &baudrate)
Return the baud rate used for serial communication. 
 
XsensResultValue storeXkfState(const CmtDeviceId deviceId=CMT_DID_MASTER)
Store important components of the XKF filter state to non-volatile memory. 
 
uint32_t getTimeoutConfig(void) const
Return the configuration mode timeout. 
 
~Cmt3()
Destructor, de-initializes, frees memory allocated for buffers, etc. 
 
XsensResultValue getProductCode(char *productCode, const CmtDeviceId deviceId=CMT_DID_MASTER)
Return product code. 
 
XsensResultValue getDataLength(uint32_t &length, const CmtDeviceId deviceId=CMT_DID_MASTER)
Retrieve data size. 
 
XsensResultValue setTimeoutMeasurement(const uint32_t timeout=CMT3_DEFAULT_TIMEOUT_MEAS)
Set the measurement mode timeout. 
 
XsensResultValue getHwError(CmtDeviceId &did) const
Return the last Hardware error code. 
 
uint32_t m_timeoutConf
The config mode timeout. 
 
XsensResultValue getSyncOutMode(uint16_t &mode)
Retrieve the outbound synchronization mode of an MT device. 
 
A structure for storing device modes using period and skip factor (new default) 
 
#define CMT3_DEFAULT_TIMEOUT_MEAS
The default timeout value for L3 data reading. 
 
XsensResultValue getEMtsData(void *buffer, const CmtDeviceId deviceId=CMT_DID_MASTER)
Retrieve the eMts data of the specified sensor(s). 
 
XsensResultValue setLocationId(uint16_t locationId, const CmtDeviceId deviceId=CMT_DID_MASTER)
Set the location ID of a sensor. 
 
bool m_measuring
Keeps track of whether the connected device is measuring or being configured. 
 
XsensResultValue setTimeoutConfig(const uint32_t timeout=CMT3_DEFAULT_TIMEOUT_CONF)
Set the configuration mode timeout. 
 
XsensResultValue setSyncInSettings(const CmtSyncInSettings &settings)
Set the inbound synchronization settings of an MT device. 
 
CmtMtTimeStamp m_rtcLastSc
The last received sample counter, used to determine wrap-around. 
 
XsensResultValue setTimeout(const uint32_t ms=CMT2_DEFAULT_TIMEOUT)
Set the default timeout value to use in blocking operations. 
 
XsensResultValue m_lastResult
The last result of an operation. 
 
bool isOpen(void) const
Return whether the communication port is open or not. 
 
bool m_useRtc
Indicates if the RTC should be computed or not (to save CPU time). 
 
bool isPortOpen(void) const
Return whether the communication port is open or not. 
 
XsensResultValue m_lastHwError
Contains the last error reported by hardware. 
 
XsensResultValue setSyncInSkipFactor(const uint16_t skipFactor)
Set the inbound synchronization skip factor of an MT device. 
 
GLuint GLsizei GLsizei * length
 
XsensResultValue setSyncMode(const uint8_t mode)
Set the sync mode of the Xbus Master. 
 
uint32_t getTimeoutMeasurement(void) const
Return the measurement mode timeout. 
 
uint16_t getSampleFrequency(void)
Return current sample frequency. 
 
XsensResultValue setBluetoothState(const bool enabled)
Set the Bluetooth state of the Xbus Master. 
 
XsensResultValue waitForDataMessage(Packet *pack)
Wait for a data message to arrive. 
 
XsensResultValue getDeviceMode2(CmtDeviceMode2 &mode, const CmtDeviceId deviceId=CMT_DID_MASTER)
Return device mode2. 
 
XsensResultValue setLogMode(bool active)
Set the logging mode. 
 
The namespace of all Xsens software since 2006. 
 
XsensResultValue peekLogMessageId(uint8_t &messageId)
Open a communication channel to. 
 
CmtDeviceConfiguration m_config
The configuration of the connected devices. 
 
XsensResultValue resetOrientation(const CmtResetMethod method, const CmtDeviceId deviceId=CMT_DID_MASTER)
Perform an orientation reset on a device. 
 
XsensResultValue getFirmwareRevision(CmtVersion &revision, const CmtDeviceId deviceId=CMT_DID_MASTER)
Return Firmware revision. 
 
XsensResultValue getSyncInSkipFactor(uint16_t &skipFactor)
Retrieve the inbound synchronization skip factor of an MT device. 
 
XsensResultValue getLogFileSize(CmtFilePos &size)
Retrieve the size of the open log file in bytes. 
 
XsensResultValue getBluetoothState(bool &enabled)
Get the state of the bluetooth communication. 
 
XsensResultValue closePort(bool gotoConfigFirst=true)
Close the communication port. 
 
XsensResultValue setScenario(const uint8_t scenarioType, const CmtDeviceId deviceId=CMT_DID_MASTER)
Specify the scenario to use in the sensor. 
 
void * m_eMtsData[CMT_MAX_DEVICES_PER_PORT]
Cached eMTS data. 
 
XsensResultValue getBusPowerState(bool &enabled)
Get the state of the Xbus power. 
 
bool m_detailedScan
Automatically scan for device details during open. 
 
A structure for storing device modes. 
 
unsigned __int32 uint32_t
 
XsensResultValue setSyncInOffset(const uint32_t offset)
Set the inbound synchronization offset of an MT device. 
 
XsensResultValue getLastResult(void) const
Return the error code of the last user function call. 
 
XsensResultValue getBaudrate(uint32_t &baudrate)
Get the baudrate used by a port. 
 
#define CMT_MAX_DEVICES_PER_PORT
 
uint32_t CmtDeviceId
The type of a Device Id. 
 
XsensResultValue setHeading(const double heading, const CmtDeviceId deviceId=CMT_DID_MASTER)
Set the heading offset. 
 
XsensResultValue setSyncOutMode(const uint16_t mode)
Set the outbound synchronization mode of an MT device. 
 
uint16_t CmtMtTimeStamp
An MT timestamp (sample count) 
 
A structure for storing scenario information. 
 
XsensResultValue getXmOutputMode(uint8_t &mode)
Return the dual-output mode of the XM. 
 
XsensResultValue gotoConfig(void)
Place all connected devices into Configuration Mode. 
 
Class for storing a single message. 
 
uint16_t m_period
The sample period of the port. 
 
#define CMT3_DEFAULT_TIMEOUT_CONF
The default timeout value for L3 configuration settings. 
 
XsensResultValue setGotoConfigTries(const uint16_t tries)
Set the number of times the gotoConfig function will attempt a gotoConfig before failing. 
 
Cmt2f m_logFile
The (optional) CMT level 2 logfile object that this class operates on. 
 
XsensResultValue getGravityMagnitude(double &magnitude, const CmtDeviceId deviceId=CMT_DID_MASTER)
Retrieve the currently used magnitude of the gravity vector. 
 
XsensResultValue getSyncOutOffset(uint32_t &offset)
Retrieve the outbound synchronization offset of an MT device.