Functions
sbgECom.c File Reference
#include "sbgECom.h"
#include <streamBuffer/sbgStreamBuffer.h>
#include "commands/sbgEComCmdCommon.h"
Include dependency graph for sbgECom.c:

Go to the source code of this file.

Functions

SbgErrorCode sbgEComClose (SbgEComHandle *pHandle)
 
void sbgEComErrorToString (SbgErrorCode errorCode, char errorMsg[256])
 
SbgErrorCode sbgEComHandle (SbgEComHandle *pHandle)
 
SbgErrorCode sbgEComHandleOneLog (SbgEComHandle *pHandle)
 
SbgErrorCode sbgEComInit (SbgEComHandle *pHandle, SbgInterface *pInterface)
 
void sbgEComSetCmdTrialsAndTimeOut (SbgEComHandle *pHandle, uint32_t numTrials, uint32_t cmdDefaultTimeOut)
 
SbgErrorCode sbgEComSetReceiveLogCallback (SbgEComHandle *pHandle, SbgEComReceiveLogFunc pReceiveLogCallback, void *pUserArg)
 

Function Documentation

◆ sbgEComClose()

SbgErrorCode sbgEComClose ( SbgEComHandle pHandle)

Close the protocol system and release associated memory.

Parameters
[in]pHandleA valid sbgECom handle to close.
Returns
SBG_NO_ERROR if we have closed and released the sbgECom system.

Definition at line 58 of file sbgECom.c.

◆ sbgEComErrorToString()

void sbgEComErrorToString ( SbgErrorCode  errorCode,
char  errorMsg[256] 
)

Convert an error code into a human readable string.

Parameters
[in]errorCodeThe errorCode to convert into a string.
[out]errorMsgString buffer used to hold the error string.

Definition at line 245 of file sbgECom.c.

◆ sbgEComHandle()

SbgErrorCode sbgEComHandle ( SbgEComHandle pHandle)

Handle all incoming logs until no more log are available in the input interface.

Parameters
[in]pHandleA valid sbgECom handle.
Returns
SBG_NO_ERROR if no error occurs during incoming logs parsing.

Definition at line 165 of file sbgECom.c.

◆ sbgEComHandleOneLog()

SbgErrorCode sbgEComHandleOneLog ( SbgEComHandle pHandle)

Try to parse one log from the input interface and then return.

Parameters
[in]pHandleA valid sbgECom handle.
Returns
SBG_NO_ERROR if no error occurs during incoming log parsing.

Definition at line 85 of file sbgECom.c.

◆ sbgEComInit()

SbgErrorCode sbgEComInit ( SbgEComHandle pHandle,
SbgInterface pInterface 
)

Initialize the protocol system used to communicate with the product and return the created handle.

Parameters
[out]pHandlePointer used to store the allocated and initialized sbgECom handle.
[in]pInterfaceInterface to use for read/write operations.
Returns
SBG_NO_ERROR if we have initialised the protocol system.

Definition at line 19 of file sbgECom.c.

◆ sbgEComSetCmdTrialsAndTimeOut()

void sbgEComSetCmdTrialsAndTimeOut ( SbgEComHandle pHandle,
uint32_t  numTrials,
uint32_t  cmdDefaultTimeOut 
)

Define the default number of trials that should be done when a command is send to the device as well as the time out.

Parameters
[in]pHandleA valid sbgECom handle. [in] numTrials Number of trials when a command is sent (starting at 1).
[in]cmdDefaultTimeOutDefault time out in milliseconds to wait to receive an answer from the device.

Definition at line 224 of file sbgECom.c.

◆ sbgEComSetReceiveLogCallback()

SbgErrorCode sbgEComSetReceiveLogCallback ( SbgEComHandle pHandle,
SbgEComReceiveLogFunc  pReceiveLogCallback,
void *  pUserArg 
)

Define the callback that should be called each time a new binary log is received.

Parameters
[in]pHandleA valid sbgECom handle.
[in]pReceiveLogCallbackPointer on the callback to call when a new log is received.
[in]pUserArgOptional user argument that will be passed to the callback method.
Returns
SBG_NO_ERROR if the callback and user argument have been defined successfully.

Definition at line 195 of file sbgECom.c.



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