sbgErrorCodes.h
Go to the documentation of this file.
1 
20 #ifndef SBG_ERROR_CODES_H
21 #define SBG_ERROR_CODES_H
22 
23 // Local headers
24 #include "sbgDefines.h"
25 
26 //----------------------------------------------------------------------//
27 //- Errors code definitions -//
28 //----------------------------------------------------------------------//
29 
33 typedef enum _SbgErrorCode
34 {
61 } SbgErrorCode;
62 
63 //----------------------------------------------------------------------//
64 //- Error codes to string litteral conversion -//
65 //----------------------------------------------------------------------//
66 
72 static inline const char *sbgErrorCodeToString(SbgErrorCode errorCode)
73 {
77  static const char *sbgErrorCodeString[] =
78  {
79  "SBG_NO_ERROR",
80  "SBG_ERROR",
81  "SBG_NULL_POINTER",
82  "SBG_INVALID_CRC",
83  "SBG_INVALID_FRAME",
84  "SBG_TIME_OUT",
85  "SBG_WRITE_ERROR",
86  "SBG_READ_ERROR",
87  "SBG_BUFFER_OVERFLOW",
88  "SBG_INVALID_PARAMETER",
89  "SBG_NOT_READY",
90  "SBG_MALLOC_FAILED",
91  "SGB_CALIB_MAG_NOT_ENOUGH_POINTS",
92  "SBG_CALIB_MAG_INVALID_TAKE",
93  "SBG_CALIB_MAG_SATURATION",
94  "SBG_CALIB_MAG_POINTS_NOT_IN_A_PLANE",
95  "SBG_DEVICE_NOT_FOUND",
96  "SBG_OPERATION_CANCELLED",
97  "SBG_NOT_CONTINUOUS_FRAME",
98  "SBG_INCOMPATIBLE_HARDWARE",
99  "SBG_INVALID_VERSION"
100  };
101 
102  assert(errorCode < SBG_ARRAY_SIZE(sbgErrorCodeString));
103  return sbgErrorCodeString[errorCode];
104 }
105 
106 #endif /* SBG_ERROR_CODES_H */
SBG_CALIB_MAG_POINTS_NOT_IN_A_PLANE
@ SBG_CALIB_MAG_POINTS_NOT_IN_A_PLANE
Definition: sbgErrorCodes.h:53
_SbgErrorCode
_SbgErrorCode
Header file that defines all error codes for SBG Systems libraries.
Definition: sbgErrorCodes.h:33
sbgErrorCodeToString
static const char * sbgErrorCodeToString(SbgErrorCode errorCode)
Definition: sbgErrorCodes.h:72
SBG_INVALID_CRC
@ SBG_INVALID_CRC
Definition: sbgErrorCodes.h:38
SBG_NOT_READY
@ SBG_NOT_READY
Definition: sbgErrorCodes.h:48
SBG_READ_ERROR
@ SBG_READ_ERROR
Definition: sbgErrorCodes.h:45
SGB_CALIB_MAG_NOT_ENOUGH_POINTS
@ SGB_CALIB_MAG_NOT_ENOUGH_POINTS
Definition: sbgErrorCodes.h:50
SBG_ARRAY_SIZE
#define SBG_ARRAY_SIZE(a)
Definition: sbgDefines.h:97
SBG_WRITE_ERROR
@ SBG_WRITE_ERROR
Definition: sbgErrorCodes.h:44
SBG_OPERATION_CANCELLED
@ SBG_OPERATION_CANCELLED
Definition: sbgErrorCodes.h:56
SBG_INVALID_VERSION
@ SBG_INVALID_VERSION
Definition: sbgErrorCodes.h:60
SBG_ERROR
@ SBG_ERROR
Definition: sbgErrorCodes.h:36
SBG_NULL_POINTER
@ SBG_NULL_POINTER
Definition: sbgErrorCodes.h:37
SBG_INVALID_PARAMETER
@ SBG_INVALID_PARAMETER
Definition: sbgErrorCodes.h:47
sbgDefines.h
SBG_NOT_CONTINUOUS_FRAME
@ SBG_NOT_CONTINUOUS_FRAME
Definition: sbgErrorCodes.h:57
SBG_CALIB_MAG_INVALID_TAKE
@ SBG_CALIB_MAG_INVALID_TAKE
Definition: sbgErrorCodes.h:51
SBG_NO_ERROR
@ SBG_NO_ERROR
Definition: sbgErrorCodes.h:35
SBG_INCOMPATIBLE_HARDWARE
@ SBG_INCOMPATIBLE_HARDWARE
Definition: sbgErrorCodes.h:59
SBG_CALIB_MAG_SATURATION
@ SBG_CALIB_MAG_SATURATION
Definition: sbgErrorCodes.h:52
SBG_TIME_OUT
@ SBG_TIME_OUT
Definition: sbgErrorCodes.h:43
SbgErrorCode
enum _SbgErrorCode SbgErrorCode
Header file that defines all error codes for SBG Systems libraries.
SBG_BUFFER_OVERFLOW
@ SBG_BUFFER_OVERFLOW
Definition: sbgErrorCodes.h:46
SBG_MALLOC_FAILED
@ SBG_MALLOC_FAILED
Definition: sbgErrorCodes.h:49
SBG_DEVICE_NOT_FOUND
@ SBG_DEVICE_NOT_FOUND
Definition: sbgErrorCodes.h:55
SBG_INVALID_FRAME
@ SBG_INVALID_FRAME
Definition: sbgErrorCodes.h:39


sbg_driver
Author(s): SBG Systems
autogenerated on Fri Oct 11 2024 02:13:40