sbgECom Library  4.0.1987-stable
C library to interface SBG Systems IMU/AHRS/INS
sbgECom.h
Go to the documentation of this file.
1 
38 #ifndef SBG_ECOM_H
39 #define SBG_ECOM_H
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
45 // sbgCommonLib headers
46 #include <sbgCommon.h>
48 
49 // Local headers
50 #include "sbgECanId.h"
51 #include "sbgEComIds.h"
52 #include "logs/sbgEComLog.h"
54 
55 //----------------------------------------------------------------------//
56 //- Predefinitions -//
57 //----------------------------------------------------------------------//
58 
62 typedef struct _SbgEComHandle SbgEComHandle;
63 
64 //----------------------------------------------------------------------//
65 //- Callbacks definitions -//
66 //----------------------------------------------------------------------//
67 
78 typedef SbgErrorCode (*SbgEComReceiveLogFunc)(SbgEComHandle *pHandle, SbgEComClass msgClass, SbgEComMsgId msg, const SbgEComLogUnion *pLogData, void *pUserArg);
79 
80 //----------------------------------------------------------------------//
81 //- Structures definitions -//
82 //----------------------------------------------------------------------//
83 
88 {
92  void *pUserArg;
94  uint32_t numTrials;
95  uint32_t cmdDefaultTimeOut;
96 };
97 
98 //----------------------------------------------------------------------//
99 //- Public methods -//
100 //----------------------------------------------------------------------//
101 
110 
118 
126 
134 
146 
154 void sbgEComSetReceiveLogCallback(SbgEComHandle *pHandle, SbgEComReceiveLogFunc pReceiveLogCallback, void *pUserArg);
155 
163 void sbgEComSetCmdTrialsAndTimeOut(SbgEComHandle *pHandle, uint32_t numTrials, uint32_t cmdDefaultTimeOut);
164 
171 void sbgEComErrorToString(SbgErrorCode errorCode, char errorMsg[256]);
172 
173 #ifdef __cplusplus
174 }
175 #endif
176 
177 #endif // SBG_ECOM_H
178 
Main header for the SBG Systems common C library.
Defines all sbgECom commands identifiers.
SbgErrorCode sbgEComHandle(SbgEComHandle *pHandle)
SbgErrorCode sbgEComInit(SbgEComHandle *pHandle, SbgInterface *pInterface)
void sbgEComSetReceiveLogCallback(SbgEComHandle *pHandle, SbgEComReceiveLogFunc pReceiveLogCallback, void *pUserArg)
SbgErrorCode(* SbgEComReceiveLogFunc)(SbgEComHandle *pHandle, SbgEComClass msgClass, SbgEComMsgId msg, const SbgEComLogUnion *pLogData, void *pUserArg)
Definition: sbgECom.h:78
void sbgEComErrorToString(SbgErrorCode errorCode, char errorMsg[256])
SbgErrorCode sbgEComHandleOneLog(SbgEComHandle *pHandle)
SbgErrorCode sbgEComClose(SbgEComHandle *pHandle)
void sbgEComSetCmdTrialsAndTimeOut(SbgEComHandle *pHandle, uint32_t numTrials, uint32_t cmdDefaultTimeOut)
SbgErrorCode sbgEComPurgeIncoming(SbgEComHandle *pHandle)
Defines all sbgECom commands identifiers.
uint8_t SbgEComMsgId
Definition: sbgEComIds.h:318
enum _SbgEComClass SbgEComClass
Parse incoming sbgECom logs and store result in an union.
Implementation of the sbgECom binary communication protocol.
enum _SbgErrorCode SbgErrorCode
This file implements the base interface for all Serial and Ethernet ports.
Definition: sbgECom.h:88
uint32_t numTrials
Definition: sbgECom.h:94
SbgEComProtocol protocolHandle
Definition: sbgECom.h:89
SbgEComReceiveLogFunc pReceiveLogCallback
Definition: sbgECom.h:91
uint32_t cmdDefaultTimeOut
Definition: sbgECom.h:95
void * pUserArg
Definition: sbgECom.h:92
Definition: sbgEComProtocol.h:124
Definition: sbgInterface.h:193
Definition: sbgEComLog.h:80