00001 #include "xsens_std.h" 00002 00003 ////////////////////////////////////////////////////////////////////////////////////////// 00004 // Retrieve a string corresponding to the given result code. 00005 const char* xsensResultText(const XsensResultValue result) 00006 { 00007 switch(result) 00008 { 00009 case XRV_OK: return "No error"; 00010 case XRV_NOBUS: return "Bus has no power"; 00011 case XRV_BUSNOTREADY: return "Bus not ready for measurement"; 00012 case XRV_INVALIDPERIOD: return "Period is invalid"; 00013 case XRV_INVALIDMSG: return "Message is invalid"; 00014 case XRV_INITBUSFAIL1: return "A slave did not respond to WaitForSetBID"; 00015 case XRV_INITBUSFAIL2: return "An incorrect answer received after WaitForSetBID"; 00016 case XRV_INITBUSFAIL3: return "After four bus-scans still undetected Motion Trackers"; 00017 case XRV_SETBIDFAIL1: return "No reply to SetBID message during SetBID procedure"; 00018 case XRV_SETBIDFAIL2: return "Other than SetBIDAck received"; 00019 case XRV_MEASUREMENTFAIL1: return "Timer overflow - period too short to collect all data from Motion Trackers"; 00020 case XRV_MEASUREMENTFAIL2: return "Motion Tracker responds with other than SlaveData message"; 00021 case XRV_MEASUREMENTFAIL3: return "Total bytes of data of Motion Trackers incl sample counter exceeds 255 bytes"; 00022 case XRV_MEASUREMENTFAIL4: return "Timer overflow during measurement – MT does not respond within measurement period. Increase period (lower sample frequency)"; 00023 case XRV_MEASUREMENTFAIL5: return "Timer overflow during measurement – MT response was not received within measurement period. Increase period (lower sample frequency) or use fewer Motion Trackers"; 00024 case XRV_MEASUREMENTFAIL6: return "No correct response from Motion Tracker during measurement"; 00025 case XRV_TIMEROVERFLOW: return "Timer overflow during measurement"; 00026 case XRV_BAUDRATEINVALID: return "Baudrate does not comply with valid range"; 00027 case XRV_INVALIDPARAM: return "Invalid parameter supplied"; 00028 case XRV_MEASUREMENTFAIL7: return "TX PC Buffer is full"; 00029 case XRV_MEASUREMENTFAIL8: return "TX PC Buffer overflow, cannot fit full message"; 00030 case XRV_CONFIGCHECKFAIL: return "Failure during device configuration"; 00031 case XRV_ERROR: return "Generic error"; 00032 case XRV_NOTIMPLEMENTED: return "Operation not implemented"; 00033 case XRV_TIMEOUT: return "Timeout occurred, some data received"; 00034 case XRV_TIMEOUTNODATA: return "Timeout occurred, no data was received"; 00035 case XRV_CHECKSUMFAULT: return "Checksum fault"; 00036 case XRV_OUTOFMEMORY: return "Out of memory"; 00037 case XRV_NOTFOUND: return "Requested item was not found"; 00038 case XRV_UNEXPECTEDMSG: return "Unexpected message received"; 00039 case XRV_INVALIDID: return "Invalid id supplied"; 00040 case XRV_INVALIDOPERATION: return "Invalid operation"; 00041 case XRV_INSUFFICIENTSPACE: return "Insufficient buffer space available"; 00042 case XRV_INPUTCANNOTBEOPENED: return "Could not open input device"; 00043 case XRV_OUTPUTCANNOTBEOPENED: return "Could not open output device"; 00044 case XRV_ALREADYOPEN: return "A device is already open"; 00045 case XRV_ENDOFFILE: return "End of file reached"; 00046 case XRV_COULDNOTREADSETTINGS: return "A required settings file could not be opened or is missing some data"; 00047 case XRV_NODATA: return "No data available"; 00048 case XRV_READONLY: return "Tried to change a read-only value"; 00049 case XRV_NULLPTR: return "Invalid NULL pointer supplied"; 00050 case XRV_INSUFFICIENTDATA: return "Insufficient data supplied"; 00051 case XRV_BUSY: return "Busy processing, try again later"; 00052 case XRV_INVALIDINSTANCE: return "Invalid instance called"; 00053 case XRV_DATACORRUPT: return "Data-source corrupt"; 00054 case XRV_READINITFAILED: return "Failure during reading of settings. File may be old or corrupt."; 00055 case XRV_NOXMFOUND: return "Could not find any MVN-compatible hardware, check connections and Xbus Master LEDs"; 00056 case XRV_ONLYONEXMFOUND: return "Found only one responding Xbus Master, check connections and Xbus Master LEDs"; 00057 case XRV_MTCOUNTZERO: return "No sensors found, check cables"; 00058 case XRV_MTLOCATIONINVALID: return "One or more sensors are not where they were expected, check locations"; 00059 case XRV_INSUFFICIENTMTS: return "Not enough sensors were found, check cables"; 00060 case XRV_INITFUSIONFAILED: return "Failure during initialization of Fusion Engine. Source file may be old or corrupt."; 00061 case XRV_OTHER: return "Something else was received than was requested"; 00062 case XRV_NOFILEOPEN: return "No file open"; 00063 case XRV_NOPORTOPEN: return "No serial port open"; 00064 case XRV_NOFILEORPORTOPEN: return "No file or serial port open"; 00065 case XRV_PORTNOTFOUND: return "A required port could not be found"; 00066 case XRV_INITPORTFAILED: return "The low-level port handler failed to initialize"; 00067 case XRV_CALIBRATIONFAILED: return "A calibration routine failed"; 00068 case XRV_ALREADYDONE: return "This once only operation has already been performed"; 00069 00070 case XRV_SYNC_SINGLE_SLAVE: return "The single connected device is configured as a slave"; 00071 case XRV_SYNC_SECOND_MASTER: return "More than one master was detected"; 00072 case XRV_SYNC_NO_SYNC: return "A device was detected that was neither master nor slave"; 00073 case XRV_SYNC_NO_MASTER: return "No master detected"; 00074 case XRV_SYNC_DATA_MISSING: return "A device is not sending enough data, check synchronization cables"; 00075 00076 case XRV_VERSION_TOO_LOW: return "The version of the object is too low for the requested operation"; 00077 case XRV_VERSION_PROBLEM: return "The object has an unrecognized version, so it's not safe to perform the operation"; 00078 00079 case XRV_DEVICEERROR: return "The device generated an error, try updating the firmware"; 00080 00081 case XRV_ABORTED: return "The process was aborted by an external event"; 00082 00083 default: return "!!Undefined Result Value!!"; 00084 } 00085 }