Go to the documentation of this file.
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;
SbgInterfaceWriteFunc pWriteFunc
SbgErrorCode(* SbgInterfaceWriteFunc)(SbgInterface *pHandle, const void *pBuffer, size_t bytesToWrite)
const SBG_INLINE char * sbgInterfaceNameGet(const SbgInterface *pInterface)
void * SbgInterfaceHandle
SBG_INLINE uint32_t sbgInterfaceTypeGet(const SbgInterface *pInterface)
SbgErrorCode(* SbgInterfaceReadFunc)(SbgInterface *pHandle, void *pBuffer, size_t *pReadBytes, size_t bytesToRead)
SbgInterfaceFlushFunc pFlushFunc
SBG_INLINE SbgErrorCode sbgInterfaceWrite(SbgInterface *pHandle, const void *pBuffer, size_t bytesToWrite)
SBG_COMMON_LIB_API void sbgInterfaceNameSet(SbgInterface *pInterface, const char *pName)
SBG_INLINE SbgErrorCode sbgInterfaceRead(SbgInterface *pHandle, void *pBuffer, size_t *pReadBytes, size_t bytesToRead)
#define SBG_IF_NAME_MAX_SIZE
This file implements the base interface for all Serial and Ethernet ports.
uint32_t(* SbgInterfaceGetDelayFunc)(SbgInterface *pHandle, size_t numBytes)
const SBG_COMMON_LIB_API char * sbgInterfaceTypeGetAsString(const SbgInterface *pInterface)
SbgInterfaceHandle handle
#define SBG_COMMON_LIB_API
Header file that contains all common definitions.
SbgErrorCode(* SbgInterfaceFlushFunc)(SbgInterface *pHandle)
SbgInterfaceReadFunc pReadFunc
SBG_COMMON_LIB_API void sbgInterfaceZeroInit(SbgInterface *pHandle)
SbgInterfaceGetDelayFunc pDelayFunc
SBG_INLINE uint32_t sbgInterfaceGetDelay(SbgInterface *pHandle, size_t numBytes)
char name[SBG_IF_NAME_MAX_SIZE]
enum _SbgErrorCode SbgErrorCode
Header file that defines all error codes for SBG Systems libraries.
SBG_INLINE SbgErrorCode sbgInterfaceFlush(SbgInterface *pHandle)
sbg_driver
Author(s): SBG Systems
autogenerated on Fri Oct 11 2024 02:13:40