24 #ifndef SBG_INTERFACE_H 25 #define SBG_INTERFACE_H 41 #define SBG_IF_NAME_MAX_SIZE (48) 46 #define SBG_IF_TYPE_UNKNOW (0) 47 #define SBG_IF_TYPE_SERIAL (1) 48 #define SBG_IF_TYPE_ETH_UDP (2) 49 #define SBG_IF_TYPE_ETH_TCP_IP (3) 50 #define SBG_IF_TYPE_FILE (4) 51 #define SBG_IF_TYPE_LAST_RESERVED (999) 53 //----------------------------------------------------------------------// 174 return pHandle->
pWriteFunc(pHandle, pBuffer, bytesToWrite);
200 return pHandle->
pReadFunc(pHandle, pBuffer, pReadBytes, bytesToRead);
256 return pHandle->
pDelayFunc(pHandle, numBytes);
272 return pInterface->
type;
293 return pInterface->
name;
#define SBG_COMMON_LIB_API
SBG_INLINE SbgErrorCode sbgInterfaceFlush(SbgInterface *pHandle)
SBG_INLINE uint32_t sbgInterfaceGetDelay(SbgInterface *pHandle, size_t numBytes)
SbgErrorCode(* SbgInterfaceWriteFunc)(SbgInterface *pHandle, const void *pBuffer, size_t bytesToWrite)
SBG_INLINE const char * sbgInterfaceNameGet(const SbgInterface *pInterface)
SbgInterfaceHandle handle
SbgInterfaceGetDelayFunc pDelayFunc
SbgInterfaceReadFunc pReadFunc
SBG_COMMON_LIB_API void sbgInterfaceZeroInit(SbgInterface *pHandle)
SBG_INLINE SbgErrorCode sbgInterfaceWrite(SbgInterface *pHandle, const void *pBuffer, size_t bytesToWrite)
#define SBG_IF_NAME_MAX_SIZE
SBG_INLINE uint32_t sbgInterfaceTypeGet(const SbgInterface *pInterface)
uint32_t(* SbgInterfaceGetDelayFunc)(SbgInterface *pHandle, size_t numBytes)
Main header file for SBG Systems common C library.
SbgErrorCode(* SbgInterfaceReadFunc)(SbgInterface *pHandle, void *pBuffer, size_t *pReadBytes, size_t bytesToRead)
void * SbgInterfaceHandle
SBG_INLINE SbgErrorCode sbgInterfaceRead(SbgInterface *pHandle, void *pBuffer, size_t *pReadBytes, size_t bytesToRead)
SbgInterfaceFlushFunc pFlushFunc
char name[SBG_IF_NAME_MAX_SIZE]
SbgInterfaceWriteFunc pWriteFunc
enum _SbgErrorCode SbgErrorCode
SBG_COMMON_LIB_API void sbgInterfaceNameSet(SbgInterface *pInterface, const char *pName)
SBG_COMMON_LIB_API const char * sbgInterfaceTypeGetAsString(const SbgInterface *pInterface)
SbgErrorCode(* SbgInterfaceFlushFunc)(SbgInterface *pHandle)