Debian Codegraph @

3rdparty/xspublic/xstypes/xsresultvalue.h

raw
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 #ifndef XSRESULTVALUE_H
34 #define XSRESULTVALUE_H
35
36 #include "xstypesconfig.h"
37
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41
42 //////////////////////////////////////////////////////////////////////////////////////////
43 /*! \addtogroup enums Global enumerations
44 @{
45 */
46 /*! \brief Xsens result values
47 \details These values are used to signal success or specific failures of functions
48 \sa XsResultValue_toString
49 */
50 enum XsResultValue {
51 // general OK
52 XRV_OK = 0 //!< 0: Operation was performed successfully
53
54 // communication protocol
55 ,XRV_NOBUS = 1 //!< 1: No bus communication possible
56 ,XRV_BUSNOTREADY = 2 //!< 2: InitBus and/or SetBID are not issued
57 ,XRV_INVALIDPERIOD = 3 //!< 3: Period sent is invalid
58 ,XRV_INVALIDMSG = 4 //!< 4: The message is invalid or not implemented
59 ,XRV_INITBUSFAIL1 = 16 //!< 16: A slave did not respond to WaitForSetBID
60 ,XRV_INITBUSFAIL2 = 17 //!< 17: An incorrect answer received after WaitForSetBID
61 ,XRV_INITBUSFAIL3 = 18 //!< 18: After four bus-scans still undetected Motion Trackers
62 ,XRV_SETBIDFAIL1 = 20 //!< 20: No reply to SetBID message during SetBID procedure
63 ,XRV_SETBIDFAIL2 = 21 //!< 21: Other than SetBIDAck received
64 ,XRV_MEASUREMENTFAIL1 = 24 //!< 24: Timer overflow - period too short to collect all data from Motion Trackers
65 ,XRV_MEASUREMENTFAIL2 = 25 //!< 25: Motion Tracker responds with other than SlaveData message
66 ,XRV_MEASUREMENTFAIL3 = 26 //!< 26: Total bytes of data of Motion Trackers including sample counter exceeds 255 bytes
67 ,XRV_MEASUREMENTFAIL4 = 27 //!< 27: Timer overflows during measurement
68 ,XRV_MEASUREMENTFAIL5 = 28 //!< 28: Timer overflows during measurement
69 ,XRV_MEASUREMENTFAIL6 = 29 //!< 29: No correct response from Motion Tracker during measurement
70 ,XRV_TIMEROVERFLOW = 30 //!< 30: Timer overflows during measurement
71 ,XRV_BAUDRATEINVALID = 32 //!< 32: Baud rate does not comply with valid range
72 ,XRV_INVALIDPARAM = 33 //!< 33: An invalid parameter is supplied
73 ,XRV_MEASUREMENTFAIL7 = 35 //!< 35: TX PC Buffer is full
74 ,XRV_MEASUREMENTFAIL8 = 36 //!< 36: TX PC Buffer overflow, cannot fit full message
75 ,XRV_WIRELESSFAIL = 37 //!< 37: Wireless subsystem failed
76 ,XRV_DEVICEERROR = 40 //!< 40: The device generated an error, try updating the firmware
77 ,XRV_DATAOVERFLOW = 41 //!< 41: The device generates more data than the bus communication can handle (baud rate may be too low)
78 ,XRV_BUFFEROVERFLOW = 42 //!< 42: The sample buffer of the device was full during a communication outage
79 ,XRV_EXTTRIGGERERROR = 43 //!< 43: The external trigger is not behaving as configured
80 ,XRV_SAMPLESTREAMERROR = 44 //!< 44: The sample stream detected an error in the ordering of sample data
81 ,XRV_POWER_DIP = 45 //!< 45: A dip in the power supply was detected and recovered from
82 ,XRV_POWER_OVERCURRENT = 46 //!< 46: A current limiter has been activated, shutting down the device
83 ,XRV_OVERHEATING = 47 //!< 47: Device temperature is not within operational limits
84 ,XRV_BATTERYLOW = 48 //!< 48: Battery level reached lower limit
85 ,XRV_INVALIDFILTERPROFILE = 49 //!< 49: Specified filter profile ID is not available on the device or the user is trying to duplicate an existing filter profile type
86 ,XRV_INVALIDSTOREDSETTINGS = 50 //!< 50: The settings stored in the device's non volatile memory are invalid
87 ,XRV_ACCESSDENIED = 51 //!< 51: Request for control of the device was denied
88 ,XRV_FILEERROR = 52 //!< 52: Failure reading, writing, opening or closing a file
89 ,XRV_OUTPUTCONFIGERROR = 53 //!< 53: Erroneous output configuration, device can not go to measurement
90
91 // CMT / XDA / XME / etc
92 ,XRV_ERROR = 256 //!< 256: A generic error occurred
93 ,XRV_NOTIMPLEMENTED = 257 //!< 257: Operation not implemented in this version (yet)
94 ,XRV_TIMEOUT = 258 //!< 258: A timeout occurred
95 ,XRV_TIMEOUTNODATA = 259 //!< 259: Operation aborted because of no data read
96 ,XRV_CHECKSUMFAULT = 260 //!< 260: Checksum fault occurred
97 ,XRV_OUTOFMEMORY = 261 //!< 261: No internal memory available
98 ,XRV_NOTFOUND = 262 //!< 262: The requested item was not found
99 ,XRV_UNEXPECTEDMSG = 263 //!< 263: Unexpected message received (e.g. no acknowledge message received)
100 ,XRV_INVALIDID = 264 //!< 264: Invalid id supplied
101 ,XRV_INVALIDOPERATION = 265 //!< 265: Operation is invalid at this point
102 ,XRV_INSUFFICIENTSPACE = 266 //!< 266: Insufficient buffer space available
103 ,XRV_INPUTCANNOTBEOPENED = 267 //!< 267: The specified i/o device can not be opened
104 ,XRV_OUTPUTCANNOTBEOPENED = 268 //!< 268: The specified i/o device can not be opened
105 ,XRV_ALREADYOPEN = 269 //!< 269: An I/O device is already opened with this object
106 ,XRV_ENDOFFILE = 270 //!< 270: End of file is reached
107 ,XRV_COULDNOTREADSETTINGS = 271 //!< 271: A required settings file could not be opened or is missing some data
108 ,XRV_NODATA = 272 //!< 272: No data is available
109 ,XRV_READONLY = 273 //!< 273: Tried to change a read-only value
110 ,XRV_NULLPTR = 274 //!< 274: Tried to supply a NULL value where it is not allowed
111 ,XRV_INSUFFICIENTDATA = 275 //!< 275: Insufficient data was supplied to a function
112 ,XRV_BUSY = 276 //!< 276: Busy processing, try again later
113 ,XRV_INVALIDINSTANCE = 277 //!< 277: Invalid instance called, because of an invalid or missing license
114 ,XRV_DATACORRUPT = 278 //!< 278: A trusted data stream proves to contain corrupted data
115
116 ,XRV_READINITFAILED = 279 //!< 279: Failure during read of settings
117 ,XRV_NOXMFOUND = 280 //!< 280: Could not find any MVN-compatible hardware
118 ,XRV_DEVICECOUNTZERO = 282 //!< 282: No xsens devices found
119 ,XRV_MTLOCATIONINVALID = 283 //!< 283: One or more sensors are not where they were expected
120 ,XRV_INSUFFICIENTMTS = 284 //!< 284: Not enough sensors were found
121 ,XRV_INITFUSIONFAILED = 285 //!< 285: Failure during initialization of Fusion Engine
122 ,XRV_OTHER = 286 //!< 286: Something else was received than was requested
123
124 ,XRV_NOFILEOPEN = 287 //!< 287: No file opened for reading/writing
125 ,XRV_NOPORTOPEN = 288 //!< 288: No serial port opened for reading/writing
126 ,XRV_NOFILEORPORTOPEN = 289 //!< 289: No file or serial port opened for reading/writing
127 ,XRV_PORTNOTFOUND = 290 //!< 290: A required port could not be found
128 ,XRV_INITPORTFAILED = 291 //!< 291: The low-level port handler failed to initialize
129 ,XRV_CALIBRATIONFAILED = 292 //!< 292: A calibration routine failed
130
131 ,XRV_CONFIGCHECKFAIL = 293 //!< 293: A configuration-time check of the device failed
132 ,XRV_ALREADYDONE = 294 //!< 294: The operation is once only and has already been performed
133
134 ,XRV_SYNC_SINGLE_SLAVE = 295 //!< 295: The single connected device is configured as a slave
135 ,XRV_SYNC_SECOND_MASTER = 296 //!< 296: More than one master was detected
136 ,XRV_SYNC_NO_SYNC = 297 //!< 297: A device was detected that was neither master nor slave
137 ,XRV_SYNC_NO_MASTER = 298 //!< 298: No master detected
138 ,XRV_SYNC_DATA_MISSING = 299 //!< 299: A device is not sending enough data
139
140 ,XRV_VERSION_TOO_LOW = 300 //!< 300: The version of the object is too low for the requested operation
141 ,XRV_VERSION_PROBLEM = 301 //!< 301: The object has an unrecognised version, so it's not safe to perform the operation
142
143 ,XRV_ABORTED = 302 //!< 302: The process was aborted by an external event, usually a user action or process termination
144 ,XRV_UNSUPPORTED = 303 //!< 303: The requested functionality is not supported by the device
145
146 ,XRV_PACKETCOUNTERMISSED = 304 //!< 304: A packet counter value was missed
147
148 ,XRV_MEASUREMENTFAILED = 305 //!< 305: An error occurred while trying to put the device in measurement mode
149 ,XRV_STARTRECORDINGFAILED = 306 //!< 306: A device could not start recording
150 ,XRV_STOPRECORDINGFAILED = 307 //!< 307: A device could not stop recording
151
152 ,XRV_RADIO_CHANNEL_IN_USE = 311 //!< 311: Radio channel is in use by another system
153 ,XRV_UNEXPECTED_DISCONNECT = 312 //!< 312: Motion tracker disconnected unexpectedly
154 ,XRV_TOO_MANY_CONNECTED_TRACKERS = 313 //!< 313: Too many motion trackers connected
155 ,XRV_GOTOCONFIGFAILED = 314 //!< 314: A device could not be put in config mode
156 ,XRV_OUTOFRANGE = 315 //!< 315: Device has gone out of range
157 ,XRV_BACKINRANGE = 316 //!< 316: Device is back in range, resuming normal operation
158 ,XRV_EXPECTED_DISCONNECT = 317 //!< 317: The device was disconnected
159
160 ,XRV_RESTORE_COMMUNICATION_FAILED = 318 //!< 318: Restore communication failed
161 ,XRV_RESTORE_COMMUNICATION_STOPPED = 319 //!< 319: Restore communication was stopped
162
163 ,XRV_EXPECTED_CONNECT = 320 //!< 320: The device was connected
164
165 // notifications
166 ,XRV_SHUTTINGDOWN = 400 //!< 400: The device is shutting down
167 ,XRV_GNSSCONFIGURATIONERROR = 401 //!< 401: A configuration item was refused by the GNSS module
168 ,XRV_GNSSCOMMTIMEOUT = 402 //!< 402: The communication with the GNSS module timed out
169 ,XRV_GNSSERROR = 403 //!< 403: Communication between the device and the GNSS module failed
170 ,XRV_DEVICE_NOT_CALIBRATED = 404 //!< 404: The EMTS of the device does not contain calibration data
171
172 };
173 /*! @} */
174 typedef enum XsResultValue XsResultValue;
175
176 //! These enum values can be used to specify a device error (XRV_DEVICEERROR 0x28), i.e. a xbus message like [FA FF 42 05 28 XXXXXXXX CS]
177 enum XsDeviceErrorType
178 {
179 XERR_Unknown = 0
180 , XERR_ImcuTimeout = 1
181 , XERR_ImcuSettingsInvalid = 2
182 , XERR_ImcuSettingsFailure = 3
183 , XERR_ImcuEmtsWriteFailure = 4
184 , XERR_ImcuEmtsReadFailure = 5
185 , XERR_DspCrashed = 6
186 , XERR_DspBootingTimeout = 7
187 , XERR_DspSettingsInvalid = 8
188 };
189 typedef enum XsDeviceErrorType XsDeviceErrorType;
190
191 //////////////////////////////////////////////////////////////////////////////////////////
192
193 /* \brief Retrieve a string corresponding to the given result code.
194
195 This function uses the XsResultText list to return a string with the relevant result
196 code in a textual format. If the supplied result code is invalid the
197 "!!Undefined Result Value!!" string is returned.
198 */
199 XSTYPES_DLL_API const char* XsResultValue_toString(XsResultValue result);
200
201 #ifdef __cplusplus
202 } // extern "C"
203 #endif
204
205 #endif