| 1 |
|
| 2 |
// Copyright (c) 2003-2019 Xsens Technologies B.V. or subsidiaries worldwide. |
| 3 |
// All rights reserved. |
| 4 |
// |
| 5 |
// Redistribution and use in source and binary forms, with or without modification, |
| 6 |
// are permitted provided that the following conditions are met: |
| 7 |
// |
| 8 |
// 1. Redistributions of source code must retain the above copyright notice, |
| 9 |
// this list of conditions, and the following disclaimer. |
| 10 |
// |
| 11 |
// 2. Redistributions in binary form must reproduce the above copyright notice, |
| 12 |
// this list of conditions, and the following disclaimer in the documentation |
| 13 |
// and/or other materials provided with the distribution. |
| 14 |
// |
| 15 |
// 3. Neither the names of the copyright holders nor the names of their contributors |
| 16 |
// may be used to endorse or promote products derived from this software without |
| 17 |
// specific prior written permission. |
| 18 |
// |
| 19 |
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY |
| 20 |
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
| 21 |
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL |
| 22 |
// THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 23 |
// SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT |
| 24 |
// OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
| 25 |
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR |
| 26 |
// TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 27 |
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.THE LAWS OF THE NETHERLANDS |
| 28 |
// SHALL BE EXCLUSIVELY APPLICABLE AND ANY DISPUTES SHALL BE FINALLY SETTLED UNDER THE RULES |
| 29 |
// OF ARBITRATION OF THE INTERNATIONAL CHAMBER OF COMMERCE IN THE HAGUE BY ONE OR MORE |
| 30 |
// ARBITRATORS APPOINTED IN ACCORDANCE WITH SAID RULES. |
| 31 |
// |
| 32 |
|
| 33 |
#include "xsresultvalue.h" |
| 34 |
|
| 35 |
/*! \addtogroup cinterface C Interface |
| 36 |
@{ |
| 37 |
*/ |
| 38 |
|
| 39 |
////////////////////////////////////////////////////////////////////////////////////////// |
| 40 |
/*! \brief Retrieve a character string corresponding to the given result code. |
| 41 |
\param result The result code to convert |
| 42 |
\return A static string describing the result code |
| 43 |
\note In the Python interface this function is called XsResultValueToString |
| 44 |
\note In C/C++ do NOT delete the returned char* as it points to static memory. |
| 45 |
*/ |
| 46 |
const char* XsResultValue_toString(XsResultValue result) |
| 47 |
{ |
| 48 |
switch(result) |
| 49 |
{ |
| 50 |
case XRV_OK: return "No error"; |
| 51 |
|
| 52 |
// Communication protocol |
| 53 |
case XRV_NOBUS: return "Bus has no power"; |
| 54 |
case XRV_BUSNOTREADY: return "Bus not ready for measurement"; |
| 55 |
case XRV_INVALIDPERIOD: return "Period is invalid"; |
| 56 |
case XRV_INVALIDMSG: return "Message is invalid"; |
| 57 |
case XRV_INITBUSFAIL1: return "A slave did not respond to WaitForSetBID"; |
| 58 |
case XRV_INITBUSFAIL2: return "An incorrect answer received after WaitForSetBID"; |
| 59 |
case XRV_INITBUSFAIL3: return "After four bus-scans still undetected Motion Trackers"; |
| 60 |
case XRV_SETBIDFAIL1: return "No reply to SetBID message during SetBID procedure"; |
| 61 |
case XRV_SETBIDFAIL2: return "Other than SetBIDAck received"; |
| 62 |
case XRV_MEASUREMENTFAIL1: return "Timer overflow - period too short to collect all data from Motion Trackers"; |
| 63 |
case XRV_MEASUREMENTFAIL2: return "Motion Tracker responds with other than SlaveData message"; |
| 64 |
case XRV_MEASUREMENTFAIL3: return "Total bytes of data of Motion Trackers incl sample counter exceeds 255 bytes"; |
| 65 |
case XRV_MEASUREMENTFAIL4: return "Timer overflow during measurement - MT does not respond within measurement period. Increase period (lower update rate)"; |
| 66 |
case XRV_MEASUREMENTFAIL5: return "Timer overflow during measurement - MT response was not received within measurement period. Increase period (lower update rate) or use fewer Motion Trackers"; |
| 67 |
case XRV_MEASUREMENTFAIL6: return "No correct response from Motion Tracker during measurement"; |
| 68 |
case XRV_TIMEROVERFLOW: return "Timer overflow during measurement"; |
| 69 |
case XRV_BAUDRATEINVALID: return "Baudrate does not comply with valid range"; |
| 70 |
case XRV_INVALIDPARAM: return "Invalid parameter supplied"; |
| 71 |
case XRV_MEASUREMENTFAIL7: return "TX PC Buffer is full"; |
| 72 |
case XRV_MEASUREMENTFAIL8: return "TX PC Buffer overflow, cannot fit full message"; |
| 73 |
case XRV_WIRELESSFAIL: return "Wireless communication system failed"; |
| 74 |
case XRV_DEVICEERROR: return "The device generated an error, try updating the firmware"; |
| 75 |
case XRV_DATAOVERFLOW: return "Data overflow"; |
| 76 |
case XRV_BUFFEROVERFLOW: return "Sample buffer overflow during communication outage"; |
| 77 |
case XRV_EXTTRIGGERERROR: return "The external trigger is not behaving as configured"; |
| 78 |
case XRV_SAMPLESTREAMERROR: return "Sample stream detected an error in ordering input data"; |
| 79 |
case XRV_POWER_DIP: return "A power dip has been detected and recovered from"; |
| 80 |
case XRV_POWER_OVERCURRENT: return "A current limiter has been activated"; |
| 81 |
case XRV_OVERHEATING: return "Device temperature exceeded operational limits"; |
| 82 |
case XRV_BATTERYLOW: return "Battery level reached lower limit"; |
| 83 |
case XRV_INVALIDFILTERPROFILE: return "Specified filter profile ID is not available on the device or the user is trying to duplicate an existing filter profile type"; |
| 84 |
case XRV_INVALIDSTOREDSETTINGS: return "The settings stored in the device's non volatile memory are invalid"; |
| 85 |
case XRV_ACCESSDENIED: return "Request for control of the device was denied"; |
| 86 |
case XRV_FILEERROR: return "Failure reading, writing, opening or closing a file"; |
| 87 |
case XRV_OUTPUTCONFIGERROR: return "Erroneous output configuration, device can not go to measurement"; |
| 88 |
|
| 89 |
// XDA / XME / etc |
| 90 |
case XRV_ERROR: return "Generic error"; |
| 91 |
case XRV_NOTIMPLEMENTED: return "Operation not implemented"; |
| 92 |
case XRV_TIMEOUT: return "Timeout occurred, some data received"; |
| 93 |
case XRV_TIMEOUTNODATA: return "Timeout occurred, no data was received"; |
| 94 |
case XRV_CHECKSUMFAULT: return "Checksum fault"; |
| 95 |
case XRV_OUTOFMEMORY: return "Out of memory"; |
| 96 |
case XRV_NOTFOUND: return "Requested item was not found"; |
| 97 |
case XRV_UNEXPECTEDMSG: return "Unexpected message received"; |
| 98 |
case XRV_INVALIDID: return "Invalid id supplied"; |
| 99 |
case XRV_INVALIDOPERATION: return "Invalid operation"; |
| 100 |
case XRV_INSUFFICIENTSPACE: return "Insufficient buffer space available"; |
| 101 |
case XRV_INPUTCANNOTBEOPENED: return "Could not open input device"; |
| 102 |
case XRV_OUTPUTCANNOTBEOPENED: return "Could not open output device"; |
| 103 |
case XRV_ALREADYOPEN: return "A device is already open"; |
| 104 |
case XRV_ENDOFFILE: return "End of file reached"; |
| 105 |
case XRV_COULDNOTREADSETTINGS: return "A required settings file could not be opened or is missing some data"; |
| 106 |
case XRV_NODATA: return "No data available"; |
| 107 |
case XRV_READONLY: return "Tried to change a read-only value"; |
| 108 |
case XRV_NULLPTR: return "Invalid NULL pointer supplied"; |
| 109 |
case XRV_INSUFFICIENTDATA: return "Insufficient data supplied"; |
| 110 |
case XRV_BUSY: return "Busy processing, try again later"; |
| 111 |
case XRV_INVALIDINSTANCE: return "Invalid instance called, because of an invalid or missing license"; |
| 112 |
case XRV_DATACORRUPT: return "Data-source corrupt"; |
| 113 |
|
| 114 |
case XRV_READINITFAILED: return "Failure during reading of settings. File may be old or corrupt."; |
| 115 |
case XRV_NOXMFOUND: return "Could not find any MVN-compatible hardware, check connections and LEDs"; |
| 116 |
case XRV_DEVICECOUNTZERO: return "No xsens devices found, check connections"; |
| 117 |
case XRV_MTLOCATIONINVALID: return "One or more sensors are not where they were expected, check locations"; |
| 118 |
case XRV_INSUFFICIENTMTS: return "Not enough sensors were found, check connections"; |
| 119 |
case XRV_INITFUSIONFAILED: return "Failure during initialization of Fusion Engine. Source file may be old or corrupt."; |
| 120 |
case XRV_OTHER: return "Something else was received than was requested"; |
| 121 |
|
| 122 |
case XRV_NOFILEOPEN: return "No file open"; |
| 123 |
case XRV_NOPORTOPEN: return "No serial port open"; |
| 124 |
case XRV_NOFILEORPORTOPEN: return "No file or serial port open"; |
| 125 |
case XRV_PORTNOTFOUND: return "A required port could not be found"; |
| 126 |
case XRV_INITPORTFAILED: return "The low-level port handler failed to initialize"; |
| 127 |
case XRV_CALIBRATIONFAILED: return "A calibration routine failed"; |
| 128 |
|
| 129 |
case XRV_CONFIGCHECKFAIL: return "Failure during device configuration"; |
| 130 |
case XRV_ALREADYDONE: return "This once only operation has already been performed"; |
| 131 |
|
| 132 |
case XRV_SYNC_SINGLE_SLAVE: return "The single connected device is configured as a slave"; |
| 133 |
case XRV_SYNC_SECOND_MASTER: return "More than one master was detected"; |
| 134 |
case XRV_SYNC_NO_SYNC: return "A device was detected that was neither master nor slave"; |
| 135 |
case XRV_SYNC_NO_MASTER: return "No master detected"; |
| 136 |
case XRV_SYNC_DATA_MISSING: return "A device is not sending enough data, check synchronization cables"; |
| 137 |
|
| 138 |
case XRV_VERSION_TOO_LOW: return "The version of the object is too low for the requested operation"; |
| 139 |
case XRV_VERSION_PROBLEM: return "The object has an unrecognized version, so it's not safe to perform the operation"; |
| 140 |
|
| 141 |
case XRV_ABORTED: return "The process was aborted by an external event"; |
| 142 |
case XRV_UNSUPPORTED: return "The requested functionality is not supported by the device"; |
| 143 |
|
| 144 |
case XRV_PACKETCOUNTERMISSED: return "A packet counter value was missed"; |
| 145 |
|
| 146 |
case XRV_MEASUREMENTFAILED: return "Failed to start measurement"; |
| 147 |
case XRV_STARTRECORDINGFAILED: return "A device could not start recording"; |
| 148 |
case XRV_STOPRECORDINGFAILED: return "A device could not stop recording"; |
| 149 |
|
| 150 |
case XRV_RADIO_CHANNEL_IN_USE: return "Detected another system using the selected radio channel"; |
| 151 |
case XRV_UNEXPECTED_DISCONNECT: return "Motion tracker disconnected unexpectedly"; |
| 152 |
case XRV_TOO_MANY_CONNECTED_TRACKERS: return "Too many motion trackers connected"; |
| 153 |
case XRV_GOTOCONFIGFAILED: return "Failed to go to config mode"; |
| 154 |
case XRV_OUTOFRANGE: return "Device has gone out of range"; |
| 155 |
case XRV_BACKINRANGE: return "Device is back in range, resuming normal operation"; |
| 156 |
case XRV_EXPECTED_DISCONNECT: return "The device was disconnected"; |
| 157 |
|
| 158 |
case XRV_RESTORE_COMMUNICATION_FAILED: return "Restore communication failed"; |
| 159 |
case XRV_RESTORE_COMMUNICATION_STOPPED: return "Restore communication was stopped"; |
| 160 |
|
| 161 |
case XRV_EXPECTED_CONNECT: return "The device connected"; |
| 162 |
|
| 163 |
case XRV_SHUTTINGDOWN: return "The device is shutting down"; |
| 164 |
case XRV_GNSSCONFIGURATIONERROR:return "A configuration item was refused by the GNSS module"; |
| 165 |
case XRV_GNSSCOMMTIMEOUT: return "The communication with the GNSS module timed out"; |
| 166 |
case XRV_GNSSERROR: return "Communication between the device and the GNSS module failed"; |
| 167 |
case XRV_DEVICE_NOT_CALIBRATED: return "The EMTS of the device does not contain calibration data"; |
| 168 |
|
| 169 |
default: return "!!Undefined Result Value!!"; |
| 170 |
} |
| 171 |
} |
| 172 |
|
| 173 |
/*! @} */ |