Go to the documentation of this file.
26 if ( (pInterface) && (pHandle) )
90 uint8_t receivedMsgClass;
230 assert(numTrials > 0);
231 assert(cmdDefaultTimeOut > 0);
255 strcpy(errorMsg,
"SBG_NO_ERROR: No error.");
258 strcpy(errorMsg,
"SBG_ERROR: Generic error.");
261 strcpy(errorMsg,
"SBG_NULL_POINTER: A pointer is null.");
264 strcpy(errorMsg,
"SBG_INVALID_CRC: The received frame has an invalid CRC.");
267 strcpy(errorMsg,
"SBG_INVALID_FRAME: The received frame is invalid.");
270 strcpy(errorMsg,
"SBG_TIME_OUT: We have a time out during frame reception.");
273 strcpy(errorMsg,
"SBG_WRITE_ERROR: All bytes hasn't been written.");
276 strcpy(errorMsg,
"SBG_READ_ERROR: All bytes hasn't been read.");
279 strcpy(errorMsg,
"SBG_BUFFER_OVERFLOW: A buffer is too small to contain so much data.");
282 strcpy(errorMsg,
"SBG_INVALID_PARAMETER: An invalid parameter has been founded.");
285 strcpy(errorMsg,
"SBG_NOT_READY: A device isn't ready (Rx isn't ready for example).");
288 strcpy(errorMsg,
"SBG_MALLOC_FAILED: Failed to allocate a buffer.");
291 strcpy(errorMsg,
"SGB_CALIB_MAG_NOT_ENOUGH_POINTS: Not enough points were available to perform magnetometers calibration.");
294 strcpy(errorMsg,
"SBG_CALIB_MAG_INVALID_TAKE: The calibration procedure could not be properly executed due to insufficient precision.");
297 strcpy(errorMsg,
"SBG_CALIB_MAG_SATURATION: Saturation were detected when attempt to calibrate magnetos.");
300 strcpy(errorMsg,
"SBG_CALIB_MAG_POINTS_NOT_IN_A_PLANE: 2D calibration procedure could not be performed.");
303 strcpy(errorMsg,
"SBG_DEVICE_NOT_FOUND: A device couldn't be founded or opened.");
306 strcpy(errorMsg,
"SBG_OPERATION_CANCELLED: An operation has been cancelled by a user.");
309 strcpy(errorMsg,
"SBG_NOT_CONTINUOUS_FRAME: We have received a frame that isn't a continuous one.");
312 strcpy(errorMsg,
"SBG_INCOMPATIBLE_HARDWARE: Hence valid, the configuration cannot be executed because of incompatible hardware.");
315 sprintf(errorMsg,
"Undefined error code: %u", errorCode);
@ SBG_CALIB_MAG_POINTS_NOT_IN_A_PLANE
SbgErrorCode sbgEComInit(SbgEComHandle *pHandle, SbgInterface *pInterface)
SbgErrorCode(* SbgEComReceiveLogFunc)(SbgEComHandle *pHandle, SbgEComClass msgClass, SbgEComMsgId msg, const SbgBinaryLogData *pLogData, void *pUserArg)
SbgErrorCode sbgEComProtocolInit(SbgEComProtocol *pHandle, SbgInterface *pInterface)
#define SBG_ECOM_MAX_PAYLOAD_SIZE
@ SGB_CALIB_MAG_NOT_ENOUGH_POINTS
SbgErrorCode sbgEComSetReceiveLogCallback(SbgEComHandle *pHandle, SbgEComReceiveLogFunc pReceiveLogCallback, void *pUserArg)
SbgErrorCode sbgEComProtocolClose(SbgEComProtocol *pHandle)
void sbgEComErrorToString(SbgErrorCode errorCode, char errorMsg[256])
SbgEComReceiveLogFunc pReceiveLogCallback
@ SBG_OPERATION_CANCELLED
SbgErrorCode sbgEComBinaryLogParse(SbgEComClass msgClass, SbgEComMsgId msg, const void *pPayload, size_t payloadSize, SbgBinaryLogData *pOutputData)
SbgErrorCode sbgEComHandleOneLog(SbgEComHandle *pHandle)
enum _SbgEComClass SbgEComClass
This file is used to parse received binary logs.
SbgErrorCode sbgEComClose(SbgEComHandle *pHandle)
SbgEComProtocol protocolHandle
uint32_t cmdDefaultTimeOut
@ SBG_NOT_CONTINUOUS_FRAME
@ SBG_CALIB_MAG_INVALID_TAKE
#define SBG_ECOM_DEFAULT_CMD_TIME_OUT
This file groups all common definitions required by all commands.
@ SBG_INCOMPATIBLE_HARDWARE
@ SBG_CALIB_MAG_SATURATION
SbgErrorCode sbgEComHandle(SbgEComHandle *pHandle)
#define SBG_LOG_WARNING(format,...)
void sbgEComSetCmdTrialsAndTimeOut(SbgEComHandle *pHandle, uint32_t numTrials, uint32_t cmdDefaultTimeOut)
enum _SbgErrorCode SbgErrorCode
Header file that defines all error codes for SBG Systems libraries.
SbgErrorCode sbgEComProtocolReceive(SbgEComProtocol *pHandle, uint8_t *pMsgClass, uint8_t *pMsg, void *pData, size_t *pSize, size_t maxSize)
SBG_INLINE bool sbgEComMsgClassIsALog(SbgEComClass msgClass)
sbg_driver
Author(s): SBG Systems
autogenerated on Fri Oct 11 2024 02:13:40