sbgECom
1.11.920-stable
|
Contains main sbgECom methods. More...
#include <sbgCommon.h>
#include "sbgEComIds.h"
#include "protocol/sbgEComProtocol.h"
#include "binaryLogs/sbgEComBinaryLogs.h"
Go to the source code of this file.
Data Structures | |
struct | _SbgEComHandle |
Typedefs | |
typedef struct _SbgEComHandle | SbgEComHandle |
typedef SbgErrorCode(* | SbgEComReceiveLogFunc) (SbgEComHandle *pHandle, SbgEComClass msgClass, SbgEComMsgId msg, const SbgBinaryLogData *pLogData, void *pUserArg) |
Functions | |
SbgErrorCode | sbgEComInit (SbgEComHandle *pHandle, SbgInterface *pInterface) |
SbgErrorCode | sbgEComClose (SbgEComHandle *pHandle) |
SbgErrorCode | sbgEComHandleOneLog (SbgEComHandle *pHandle) |
SbgErrorCode | sbgEComHandle (SbgEComHandle *pHandle) |
SbgErrorCode | sbgEComSetReceiveLogCallback (SbgEComHandle *pHandle, SbgEComReceiveLogFunc pReceiveLogCallback, void *pUserArg) |
void | sbgEComSetCmdTrialsAndTimeOut (SbgEComHandle *pHandle, uint32_t numTrials, uint32_t cmdDefaultTimeOut) |
void | sbgEComErrorToString (SbgErrorCode errorCode, char errorMsg[256]) |
Contains main sbgECom methods.
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.
typedef struct _SbgEComHandle SbgEComHandle |
Interface structure pre-definition.
typedef SbgErrorCode(* SbgEComReceiveLogFunc) (SbgEComHandle *pHandle, SbgEComClass msgClass, SbgEComMsgId msg, const SbgBinaryLogData *pLogData, void *pUserArg) |
Callback definition called each time a new log is received.
[in] | pHandle | Valid handle on the sbgECom instance that has called this callback. |
[in] | msgClass | Class of the message we have received |
[in] | msg | Message ID of the log received. |
[in] | pLogData | Contains the received log data as an union. |
[in] | pUserArg | Optional user supplied argument. |
SbgErrorCode sbgEComInit | ( | SbgEComHandle * | pHandle, |
SbgInterface * | pInterface | ||
) |
Initialize the protocol system used to communicate with the product and return the created handle.
[out] | pHandle | Pointer used to store the allocated and initialized sbgECom handle. |
[in] | pInterface | Interface to use for read/write operations. |
SbgErrorCode sbgEComClose | ( | SbgEComHandle * | pHandle | ) |
Close the protocol system and release associated memory.
[in] | pHandle | A valid sbgECom handle to close. |
SbgErrorCode sbgEComHandleOneLog | ( | SbgEComHandle * | pHandle | ) |
Try to parse one log from the input interface and then return.
[in] | pHandle | A valid sbgECom handle. |
SbgErrorCode sbgEComHandle | ( | SbgEComHandle * | pHandle | ) |
Handle all incoming logs until no more log are available in the input interface.
[in] | pHandle | A valid sbgECom handle. |
SbgErrorCode sbgEComSetReceiveLogCallback | ( | SbgEComHandle * | pHandle, |
SbgEComReceiveLogFunc | pReceiveLogCallback, | ||
void * | pUserArg | ||
) |
Define the callback that should be called each time a new binary log is received.
[in] | pHandle | A valid sbgECom handle. |
[in] | pReceiveLogCallback | Pointer on the callback to call when a new log is received. |
[in] | pUserArg | Optional user argument that will be passed to the callback method. |
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.
[in] | pHandle | A valid sbgECom handle. [in] numTrials Number of trials when a command is sent (starting at 1). |
[in] | cmdDefaultTimeOut | Default time out in milliseconds to wait to receive an answer from the device. |
void sbgEComErrorToString | ( | SbgErrorCode | errorCode, |
char | errorMsg[256] | ||
) |
Convert an error code into a human readable string.
[in] | errorCode | The errorCode to convert into a string. |
[out] | errorMsg | String buffer used to hold the error string. |