sbgECom Library  4.0.1987-stable
C library to interface SBG Systems IMU/AHRS/INS
sbgErrorCodes.h
Go to the documentation of this file.
1 
33 #ifndef SBG_ERROR_CODES_H
34 #define SBG_ERROR_CODES_H
35 
36 // Local headers
37 #include "sbgDefines.h"
38 
39 //----------------------------------------------------------------------//
40 //- Errors code definitions -//
41 //----------------------------------------------------------------------//
42 
46 typedef enum _SbgErrorCode
47 {
75 
76 //----------------------------------------------------------------------//
77 //- Error codes to string litteral conversion -//
78 //----------------------------------------------------------------------//
79 
85 static inline const char *sbgErrorCodeToString(SbgErrorCode errorCode)
86 {
90  static const char *sbgErrorCodeString[] =
91  {
92  "SBG_NO_ERROR",
93  "SBG_ERROR",
94  "SBG_NULL_POINTER",
95  "SBG_INVALID_CRC",
96  "SBG_INVALID_FRAME",
97  "SBG_TIME_OUT",
98  "SBG_WRITE_ERROR",
99  "SBG_READ_ERROR",
100  "SBG_BUFFER_OVERFLOW",
101  "SBG_INVALID_PARAMETER",
102  "SBG_NOT_READY",
103  "SBG_MALLOC_FAILED",
104  "SGB_CALIB_MAG_NOT_ENOUGH_POINTS",
105  "SBG_CALIB_MAG_INVALID_TAKE",
106  "SBG_CALIB_MAG_SATURATION",
107  "SBG_CALIB_MAG_POINTS_NOT_IN_A_PLANE",
108  "SBG_DEVICE_NOT_FOUND",
109  "SBG_OPERATION_CANCELLED",
110  "SBG_NOT_CONTINUOUS_FRAME",
111  "SBG_INCOMPATIBLE_HARDWARE",
112  "SBG_INVALID_VERSION"
113  };
114 
115  assert(errorCode < SBG_ARRAY_SIZE(sbgErrorCodeString));
116  return sbgErrorCodeString[errorCode];
117 }
118 
119 #endif /* SBG_ERROR_CODES_H */
Header file that contains all common definitions.
enum _SbgErrorCode SbgErrorCode
_SbgErrorCode
Definition: sbgErrorCodes.h:47
@ SBG_ERROR
Definition: sbgErrorCodes.h:49
@ SBG_READ_ERROR
Definition: sbgErrorCodes.h:58
@ SBG_TIME_OUT
Definition: sbgErrorCodes.h:56
@ SBG_MALLOC_FAILED
Definition: sbgErrorCodes.h:62
@ SBG_BUFFER_OVERFLOW
Definition: sbgErrorCodes.h:59
@ SBG_NULL_POINTER
Definition: sbgErrorCodes.h:50
@ SBG_INCOMPATIBLE_HARDWARE
Definition: sbgErrorCodes.h:72
@ SBG_NO_ERROR
Definition: sbgErrorCodes.h:48
@ SBG_INVALID_CRC
Definition: sbgErrorCodes.h:51
@ SBG_DEVICE_NOT_FOUND
Definition: sbgErrorCodes.h:68
@ SBG_INVALID_VERSION
Definition: sbgErrorCodes.h:73
@ SBG_WRITE_ERROR
Definition: sbgErrorCodes.h:57
@ SBG_NOT_READY
Definition: sbgErrorCodes.h:61
@ SGB_CALIB_MAG_NOT_ENOUGH_POINTS
Definition: sbgErrorCodes.h:63
@ SBG_INVALID_FRAME
Definition: sbgErrorCodes.h:52
@ SBG_CALIB_MAG_SATURATION
Definition: sbgErrorCodes.h:65
@ SBG_NOT_CONTINUOUS_FRAME
Definition: sbgErrorCodes.h:70
@ SBG_CALIB_MAG_POINTS_NOT_IN_A_PLANE
Definition: sbgErrorCodes.h:66
@ SBG_OPERATION_CANCELLED
Definition: sbgErrorCodes.h:69
@ SBG_CALIB_MAG_INVALID_TAKE
Definition: sbgErrorCodes.h:64
@ SBG_INVALID_PARAMETER
Definition: sbgErrorCodes.h:60