00001 00002 /*! \cond NODOXYGEN */ 00003 00004 #ifndef _XSENS_STD_H_2006_09_11 00005 # define _XSENS_STD_H_2006_09_11 00006 00007 ////////////////////////////////////////////////////////////////////////////////////////// 00008 00009 #if defined(_WIN32) && !defined(_WIN32_WINNT) 00010 # define _WIN32_WINNT 0x0502 00011 #endif 00012 00013 #ifdef _WIN32 00014 # include <windows.h> 00015 #endif 00016 00017 /*! \endcond */ 00018 00019 ////////////////////////////////////////////////////////////////////////////////////////// 00020 //! Xsens return values 00021 // NOTE!!! When adding a value to this list, also add its description in xsens_std.cpp 00022 typedef enum /*! \cond NODOXYGEN */ _XsensResultValue_ /*! \endcond */ { 00023 // general OK 00024 XRV_OK = 0 //!< Operation was performed successfully 00025 00026 // communication protocol 00027 ,XRV_NOBUS = 1 //!< No bus communication possible 00028 ,XRV_BUSNOTREADY = 2 //!< InitBus and/or SetBID are not issued 00029 ,XRV_INVALIDPERIOD = 3 //!< Period sent is invalid 00030 ,XRV_INVALIDMSG = 4 //!< The message is invalid or not implemented 00031 ,XRV_INITBUSFAIL1 = 16 //!< A slave did not respond to WaitForSetBID 00032 ,XRV_INITBUSFAIL2 = 17 //!< An incorrect answer received after WaitForSetBID 00033 ,XRV_INITBUSFAIL3 = 18 //!< After four bus-scans still undetected Motion Trackers 00034 ,XRV_SETBIDFAIL1 = 20 //!< No reply to SetBID message during SetBID procedure 00035 ,XRV_SETBIDFAIL2 = 21 //!< Other than SetBIDAck received 00036 ,XRV_MEASUREMENTFAIL1 = 24 //!< Timer overflow - period too short to collect all data from Motion Trackers 00037 ,XRV_MEASUREMENTFAIL2 = 25 //!< Motion Tracker responds with other than SlaveData message 00038 ,XRV_MEASUREMENTFAIL3 = 26 //!< Total bytes of data of Motion Trackers including sample counter exceeds 255 bytes 00039 ,XRV_MEASUREMENTFAIL4 = 27 //!< Timer overflows during measurement 00040 ,XRV_MEASUREMENTFAIL5 = 28 //!< Timer overflows during measurement 00041 ,XRV_MEASUREMENTFAIL6 = 29 //!< No correct response from Motion Tracker during measurement 00042 ,XRV_TIMEROVERFLOW = 30 //!< Timer overflows during measurement 00043 ,XRV_BAUDRATEINVALID = 32 //!< Baud rate does not comply with valid range 00044 ,XRV_PARAMINVALID = 33 //!< An invalid parameter is supplied 00045 ,XRV_INVALIDPARAM = 33 //!< An invalid parameter is supplied 00046 ,XRV_MEASUREMENTFAIL7 = 35 //!< TX PC Buffer is full 00047 ,XRV_MEASUREMENTFAIL8 = 36 //!< TX PC Buffer overflow, cannot fit full message 00048 ,XRV_DEVICEERROR = 40 //!< The device generated an error, try updating the firmware 00049 00050 // CMT / XME / etc 00051 ,XRV_ERROR = 256 //!< A generic error occurred 00052 ,XRV_NOTIMPLEMENTED = 257 //!< Operation not implemented in this version (yet) 00053 ,XRV_TIMEOUT = 258 //!< A timeout occurred 00054 ,XRV_TIMEOUTNODATA = 259 //!< Operation aborted because of no data read 00055 ,XRV_CHECKSUMFAULT = 260 //!< Checksum fault occurred 00056 ,XRV_OUTOFMEMORY = 261 //!< No internal memory available 00057 ,XRV_NOTFOUND = 262 //!< The requested item was not found 00058 ,XRV_UNEXPECTEDMSG = 263 //!< Unexpected message received (e.g. no acknowledge message received) 00059 ,XRV_INVALIDID = 264 //!< Invalid id supplied 00060 ,XRV_INVALIDOPERATION = 265 //!< Operation is invalid at this point 00061 ,XRV_INSUFFICIENTSPACE = 266 //!< Insufficient buffer space available 00062 ,XRV_INPUTCANNOTBEOPENED = 267 //!< The specified i/o device can not be opened 00063 ,XRV_OUTPUTCANNOTBEOPENED = 268 //!< The specified i/o device can not be opened 00064 ,XRV_ALREADYOPEN = 269 //!< An I/O device is already opened with this object 00065 ,XRV_ENDOFFILE = 270 //!< End of file is reached 00066 ,XRV_COULDNOTREADSETTINGS = 271 //!< A required settings file could not be opened or is missing some data 00067 ,XRV_NODATA = 272 //!< No data is available 00068 ,XRV_READONLY = 273 //!< Tried to change a read-only value 00069 ,XRV_NULLPTR = 274 //!< Tried to supply a NULL value where it is not allowed 00070 ,XRV_INSUFFICIENTDATA = 275 //!< Insufficient data was supplied to a function 00071 ,XRV_BUSY = 276 //!< Busy processing, try again later 00072 ,XRV_INVALIDINSTANCE = 277 //!< Invalid instance called 00073 ,XRV_DATACORRUPT = 278 //!< A trusted data stream proves to contain corrupted data 00074 00075 ,XRV_READINITFAILED = 279 //!< Failure during read of settings 00076 ,XRV_NOXMFOUND = 280 //!< Could not find any MVN-compatible hardware 00077 ,XRV_ONLYONEXMFOUND = 281 //!< Found only one responding Xbus Master 00078 ,XRV_MTCOUNTZERO = 282 //!< No sensors found 00079 ,XRV_MTLOCATIONINVALID = 283 //!< One or more sensors are not where they were expected 00080 ,XRV_INSUFFICIENTMTS = 284 //!< Not enough sensors were found 00081 ,XRV_INITFUSIONFAILED = 285 //!< Failure during initialization of Fusion Engine 00082 ,XRV_OTHER = 286 //!< Something else was received than was requested 00083 00084 ,XRV_NOFILEOPEN = 287 //!< No file opened for reading/writing 00085 ,XRV_NOPORTOPEN = 288 //!< No serial port opened for reading/writing 00086 ,XRV_NOFILEORPORTOPEN = 289 //!< No file or serial port opened for reading/writing 00087 ,XRV_PORTNOTFOUND = 290 //!< A required port could not be found 00088 ,XRV_INITPORTFAILED = 291 //!< The low-level port handler failed to initialize 00089 ,XRV_CALIBRATIONFAILED = 292 //!< A calibration routine failed 00090 00091 ,XRV_CONFIGCHECKFAIL = 293 //!< The in-config check of the device failed 00092 ,XRV_ALREADYDONE = 294 //!< The operation is once only and has already been performed 00093 00094 ,XRV_SYNC_SINGLE_SLAVE = 295 //!< The single connected device is configured as a slave 00095 ,XRV_SYNC_SECOND_MASTER = 296 //!< More than one master was detected 00096 ,XRV_SYNC_NO_SYNC = 297 //!< A device was detected that was neither master nor slave 00097 ,XRV_SYNC_NO_MASTER = 298 //!< No master detected 00098 ,XRV_SYNC_DATA_MISSING = 299 //!< A device is not sending enough data 00099 00100 ,XRV_VERSION_TOO_LOW = 300 //!< The version of the object is too low for the requested operation 00101 ,XRV_VERSION_PROBLEM = 301 //!< The object has an unrecognized version, so it's not safe to perform the operation 00102 00103 ,XRV_ABORTED = 302 //!< The process was aborted by an external event, usually a user action or process termination 00104 } XsensResultValue; 00105 00106 ////////////////////////////////////////////////////////////////////////////////////////// 00107 00108 /*! \cond NODOXYGEN */ 00109 #ifndef DELNUL 00110 //! This macro deletes a pointer and sets it to NULL 00111 #define DELNUL(ptr) { delete ptr; ptr = NULL; } 00112 //! This macro deletes a pointer if it is not NULL and then sets it to NULL 00113 #define CHKDELNUL(ptr) { if (ptr != NULL) { delete ptr; ptr = NULL; } } 00114 //! This macro deletes a multi-object pointer and sets it to NULL 00115 #define LSTDELNUL(ptr) { delete[] ptr; ptr = NULL; } 00116 //! This macro deletes a multi-object pointer if it is not NULL and then sets it to NULL 00117 #define LSTCHKDELNUL(ptr) { if (ptr != NULL) { delete[] ptr; ptr = NULL; } } 00118 00119 //! This macro frees a pointer and then sets it to NULL 00120 #define FREENUL(ptr) { free(ptr); ptr = NULL; } 00121 //! This macro frees a pointer if it is not NULL and then sets it to NULL 00122 #define CHKFREENUL(ptr) { if (ptr != NULL) { free(ptr); ptr = NULL; } } 00123 #endif 00124 /*! \endcond */ 00125 00126 ////////////////////////////////////////////////////////////////////////////////////////// 00127 00128 /* \brief Retrieve a string corresponding to the given result code. 00129 00130 This function uses the CmtResultText list to return a string with the relevant result 00131 code in a textual format. If the supplied result code is invalid the 00132 "!!Invalid result code!!" string is returned. 00133 */ 00134 #if !defined(_CMT_DLL_IMPORT) && !defined(_XME_DLL_IMPORT) 00135 const char* xsensResultText(const XsensResultValue result); 00136 #endif 00137 00138 ////////////////////////////////////////////////////////////////////////////////////////// 00139 00140 #define XSENS_LABEL_SIZE 256 //!< The maximum length of a label 00141 #define XSENS_SHORT_STRING_SIZE 256 //!< The maximum length of a short string 00142 #define XSENS_LONG_STRING_SIZE 16384 //!< The maximum length of a long string 00143 00144 ////////////////////////////////////////////////////////////////////////////////////////// 00145 00146 #endif // _XSENS_STD_H_2006_09_11