external
sbgECom
common
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
{
35
SBG_NO_ERROR
= 0,
36
SBG_ERROR
,
37
SBG_NULL_POINTER
,
38
SBG_INVALID_CRC
,
39
SBG_INVALID_FRAME
,
43
SBG_TIME_OUT
,
44
SBG_WRITE_ERROR
,
45
SBG_READ_ERROR
,
46
SBG_BUFFER_OVERFLOW
,
47
SBG_INVALID_PARAMETER
,
48
SBG_NOT_READY
,
49
SBG_MALLOC_FAILED
,
50
SGB_CALIB_MAG_NOT_ENOUGH_POINTS
,
51
SBG_CALIB_MAG_INVALID_TAKE
,
52
SBG_CALIB_MAG_SATURATION
,
53
SBG_CALIB_MAG_POINTS_NOT_IN_A_PLANE
,
55
SBG_DEVICE_NOT_FOUND
,
56
SBG_OPERATION_CANCELLED
,
57
SBG_NOT_CONTINUOUS_FRAME
,
59
SBG_INCOMPATIBLE_HARDWARE
,
60
SBG_INVALID_VERSION
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_NULL_POINTER
Definition:
sbgErrorCodes.h:37
SBG_CALIB_MAG_INVALID_TAKE
Definition:
sbgErrorCodes.h:51
SBG_ERROR
Definition:
sbgErrorCodes.h:36
sbgErrorCodeToString
static const char * sbgErrorCodeToString(SbgErrorCode errorCode)
Definition:
sbgErrorCodes.h:72
SBG_WRITE_ERROR
Definition:
sbgErrorCodes.h:44
SBG_TIME_OUT
Definition:
sbgErrorCodes.h:43
SBG_MALLOC_FAILED
Definition:
sbgErrorCodes.h:49
SBG_INVALID_PARAMETER
Definition:
sbgErrorCodes.h:47
SBG_DEVICE_NOT_FOUND
Definition:
sbgErrorCodes.h:55
SBG_INVALID_FRAME
Definition:
sbgErrorCodes.h:39
SBG_CALIB_MAG_POINTS_NOT_IN_A_PLANE
Definition:
sbgErrorCodes.h:53
SBG_INVALID_VERSION
Definition:
sbgErrorCodes.h:60
SBG_INVALID_CRC
Definition:
sbgErrorCodes.h:38
SGB_CALIB_MAG_NOT_ENOUGH_POINTS
Definition:
sbgErrorCodes.h:50
SBG_NOT_CONTINUOUS_FRAME
Definition:
sbgErrorCodes.h:57
SBG_BUFFER_OVERFLOW
Definition:
sbgErrorCodes.h:46
SBG_ARRAY_SIZE
#define SBG_ARRAY_SIZE(a)
Definition:
sbgDefines.h:97
SBG_NO_ERROR
Definition:
sbgErrorCodes.h:35
SBG_READ_ERROR
Definition:
sbgErrorCodes.h:45
SBG_INCOMPATIBLE_HARDWARE
Definition:
sbgErrorCodes.h:59
SBG_OPERATION_CANCELLED
Definition:
sbgErrorCodes.h:56
SBG_CALIB_MAG_SATURATION
Definition:
sbgErrorCodes.h:52
sbgDefines.h
Header file that contains all common definitions.
SbgErrorCode
enum _SbgErrorCode SbgErrorCode
SBG_NOT_READY
Definition:
sbgErrorCodes.h:48
_SbgErrorCode
_SbgErrorCode
Definition:
sbgErrorCodes.h:33
sbg_driver
Author(s): SBG Systems
autogenerated on Sat Sep 3 2022 02:53:36