sbgEComProtocol.h
Go to the documentation of this file.
1 
25 #ifndef __SBG_ECOM_PROTOCOL_H__
26 #define __SBG_ECOM_PROTOCOL_H__
27 
28 #include <sbgCommon.h>
31 
32 //----------------------------------------------------------------------//
33 //- Global definitions -//
34 //----------------------------------------------------------------------//
35 #define SBG_ECOM_MAX_BUFFER_SIZE (4096)
36 #define SBG_ECOM_MAX_PAYLOAD_SIZE (4086)
37 #define SBG_ECOM_SYNC_1 (0xFF)
38 #define SBG_ECOM_SYNC_2 (0x5A)
39 #define SBG_ECOM_ETX (0x33)
41 #define SBG_ECOM_RX_TIME_OUT (450)
43 //----------------------------------------------------------------------//
44 //- Communication protocol structs and definitions -//
45 //----------------------------------------------------------------------//
46 
50 typedef struct _SbgEComProtocol
51 {
54  size_t rxBufferSize;
56 
57 //----------------------------------------------------------------------//
58 //- Communication protocol operations -//
59 //----------------------------------------------------------------------//
60 
68 
75 
85 SbgErrorCode sbgEComProtocolSend(SbgEComProtocol *pHandle, uint8_t msgClass, uint8_t msg, const void *pData, size_t size);
86 
101 SbgErrorCode sbgEComProtocolReceive(SbgEComProtocol *pHandle, uint8_t *pMsgClass, uint8_t *pMsg, void *pData, size_t *pSize, size_t maxSize);
102 
103 //----------------------------------------------------------------------//
104 //- Frame generation to stream buffer -//
105 //----------------------------------------------------------------------//
106 
118 SbgErrorCode sbgEComStartFrameGeneration(SbgStreamBuffer *pOutputStream, uint8_t msgClass, uint8_t msg, size_t *pStreamCursor);
119 
130 SbgErrorCode sbgEComFinalizeFrameGeneration(SbgStreamBuffer *pOutputStream, size_t streamCursor);
131 
132 #endif
SbgInterface * pLinkedInterface
This file implements the base interface for all Serial and Ethernet ports.
Used to read/write data from/to a memory buffer stream.
SbgErrorCode sbgEComProtocolClose(SbgEComProtocol *pHandle)
struct _SbgEComProtocol SbgEComProtocol
uint8_t rxBuffer[SBG_ECOM_MAX_BUFFER_SIZE]
SbgErrorCode sbgEComProtocolInit(SbgEComProtocol *pHandle, SbgInterface *pInterface)
SbgErrorCode sbgEComProtocolReceive(SbgEComProtocol *pHandle, uint8_t *pMsgClass, uint8_t *pMsg, void *pData, size_t *pSize, size_t maxSize)
SbgErrorCode sbgEComProtocolSend(SbgEComProtocol *pHandle, uint8_t msgClass, uint8_t msg, const void *pData, size_t size)
Main header file for SBG Systems common C library.
SbgErrorCode sbgEComStartFrameGeneration(SbgStreamBuffer *pOutputStream, uint8_t msgClass, uint8_t msg, size_t *pStreamCursor)
SbgErrorCode sbgEComFinalizeFrameGeneration(SbgStreamBuffer *pOutputStream, size_t streamCursor)
enum _SbgErrorCode SbgErrorCode
#define SBG_ECOM_MAX_BUFFER_SIZE


sbg_driver
Author(s): SBG Systems
autogenerated on Sat Sep 3 2022 02:53:36