Classes | Typedefs | Functions
sbgECom.h File Reference

Contains main sbgECom methods. More...

#include <sbgCommon.h>
#include "sbgEComIds.h"
#include "protocol/sbgEComProtocol.h"
#include "binaryLogs/sbgEComBinaryLogs.h"
Include dependency graph for sbgECom.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _SbgEComHandle
 

Typedefs

typedef struct _SbgEComHandle SbgEComHandle
 
typedef SbgErrorCode(* SbgEComReceiveFunc) (SbgEComHandle *pHandle, SbgEComCmdId logCmd, const SbgBinaryLogData *pLogData, void *pUserArg)
 
typedef SbgErrorCode(* SbgEComReceiveLogFunc) (SbgEComHandle *pHandle, SbgEComClass msgClass, SbgEComMsgId msg, const SbgBinaryLogData *pLogData, void *pUserArg)
 

Functions

 SBG_DEPRECATED (SbgErrorCode sbgEComSetReceiveCallback(SbgEComHandle *pHandle, SbgEComReceiveFunc pReceiveCallback, void *pUserArg))
 
SbgErrorCode sbgEComClose (SbgEComHandle *pHandle)
 
void sbgEComErrorToString (SbgErrorCode errorCode, char errorMsg[256])
 
uint32 sbgEComGetVersion (void)
 
const char * sbgEComGetVersionAsString (void)
 
SbgErrorCode sbgEComHandle (SbgEComHandle *pHandle)
 
SbgErrorCode sbgEComHandleOneLog (SbgEComHandle *pHandle)
 
SbgErrorCode sbgEComInit (SbgEComHandle *pHandle, SbgInterface *pInterface)
 
void sbgEComSetCmdTrialsAndTimeOut (SbgEComHandle *pHandle, uint32 numTrials, uint32 cmdDefaultTimeOut)
 
SbgErrorCode sbgEComSetReceiveLogCallback (SbgEComHandle *pHandle, SbgEComReceiveLogFunc pReceiveLogCallback, void *pUserArg)
 

Detailed Description

Contains main sbgECom methods.

Author
SBG Systems (Raphael Siryani)
Date
05 February 2013

Copyright Notice

Copyright (C) 2007-2013, SBG Systems SAS. All rights reserved.

This source code is intended for use only by SBG Systems SAS and those that have explicit written permission to use it from SBG Systems SAS.

THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.

Definition in file sbgECom.h.

Typedef Documentation

typedef struct _SbgEComHandle SbgEComHandle

Interface structure pre-definition.

Definition at line 46 of file sbgECom.h.

typedef SbgErrorCode(* SbgEComReceiveFunc) (SbgEComHandle *pHandle, SbgEComCmdId logCmd, const SbgBinaryLogData *pLogData, void *pUserArg)

DEPRECATED. Callback definition called each time a new log is received.

Parameters
[in]pHandleValid handle on the sbgECom instance that has called this callback.
[in]logCmdContains the binary received log command id (msg + class).
[in]pLogDataContains the received log data as an union.
[in]pUserArgOptional user supplied argument.
Returns
SBG_NO_ERROR if the received log has been used successfully.

Definition at line 60 of file sbgECom.h.

typedef SbgErrorCode(* SbgEComReceiveLogFunc) (SbgEComHandle *pHandle, SbgEComClass msgClass, SbgEComMsgId msg, const SbgBinaryLogData *pLogData, void *pUserArg)

Callback definition called each time a new log is received.

Parameters
[in]pHandleValid handle on the sbgECom instance that has called this callback.
[in]msgClassClass of the message we have received
[in]msgMessage ID of the log received.
[in]pLogDataContains the received log data as an union.
[in]pUserArgOptional user supplied argument.
Returns
SBG_NO_ERROR if the received log has been used successfully.

Definition at line 71 of file sbgECom.h.

Function Documentation

SBG_DEPRECATED ( SbgErrorCode   sbgEComSetReceiveCallbackSbgEComHandle *pHandle, SbgEComReceiveFunc pReceiveCallback, void *pUserArg)

DEPRECATED FUNCTION. Define the callback that should be called each time a new binary log is received. Please use sbgEComSetInputLogsCallback instead

Parameters
[in]pHandleA valid sbgECom handle.
[in]pReceiveCallbackPointer 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.
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 60 of file sbgECom.c.

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 305 of file sbgECom.c.

uint32 sbgEComGetVersion ( void  )

Returns an integer representing the version of the sbgCom library.

Returns
An integer representing the version of the sbgCom library.
Use SBG_VERSION_GET_MAJOR, SBG_VERSION_GET_MINOR, SBG_VERSION_GET_REV and SBG_VERSION_GET_BUILD.

Definition at line 286 of file sbgECom.c.

const char* sbgEComGetVersionAsString ( void  )

Retreive the sbgCom library version as a string (1.0.0.0).

Returns
Null terminated string that contains the sbgCom library version.

Definition at line 295 of file sbgECom.c.

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 176 of file sbgECom.c.

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 87 of file sbgECom.c.

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 20 of file sbgECom.c.

void sbgEComSetCmdTrialsAndTimeOut ( SbgEComHandle pHandle,
uint32  numTrials,
uint32  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 265 of file sbgECom.c.

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 236 of file sbgECom.c.



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