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 msgClass, uint8 msg, const void *pData, size_t size);
86 
101 SbgErrorCode sbgEComProtocolReceive(SbgEComProtocol *pHandle, uint8 *pMsgClass, uint8 *pMsg, void *pData, size_t *pSize, size_t maxSize);
102 
103 //----------------------------------------------------------------------//
104 //- Frame generation to stream buffer -//
105 //----------------------------------------------------------------------//
106 
118 
125 
126 #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 sbgEComProtocolSend(SbgEComProtocol *pHandle, uint8 msgClass, uint8 msg, const void *pData, size_t size)
SbgErrorCode sbgEComProtocolClose(SbgEComProtocol *pHandle)
struct _SbgEComProtocol SbgEComProtocol
uint8 rxBuffer[SBG_ECOM_MAX_BUFFER_SIZE]
SbgErrorCode sbgEComFinalizeFrameGeneration(SbgStreamBuffer *pOutputStream)
SbgErrorCode sbgEComProtocolInit(SbgEComProtocol *pHandle, SbgInterface *pInterface)
Main header file for SBG Systems common C library.
SbgErrorCode sbgEComProtocolReceive(SbgEComProtocol *pHandle, uint8 *pMsgClass, uint8 *pMsg, void *pData, size_t *pSize, size_t maxSize)
unsigned char uint8
Definition: sbgTypes.h:56
SbgErrorCode sbgEComStartFrameGeneration(SbgStreamBuffer *pOutputStream, uint8 msgClass, uint8 msg)
enum _SbgErrorCode SbgErrorCode
#define SBG_ECOM_MAX_BUFFER_SIZE


sbg_driver
Author(s):
autogenerated on Sun Jan 27 2019 03:42:20