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

Go to the source code of this file.

Functions

SbgErrorCode sbgEComCmdGenericGetModelId (SbgEComHandle *pHandle, uint8_t msgClass, uint8_t msg, uint32_t *pModelId)
 
SbgErrorCode sbgEComCmdGenericGetModelInfo (SbgEComHandle *pHandle, uint8_t msgClass, uint8_t msg, SbgEComModelInfo *pModelInfo)
 
SbgErrorCode sbgEComCmdGenericSetModelId (SbgEComHandle *pHandle, uint8_t msgClass, uint8_t msg, uint32_t modelId)
 
SbgErrorCode sbgEComReceiveAnyCmd (SbgEComHandle *pHandle, uint8_t *pMsgClass, uint8_t *pMsg, void *pData, size_t *pSize, size_t maxSize, uint32_t timeOut)
 
SbgErrorCode sbgEComReceiveCmd (SbgEComHandle *pHandle, uint8_t msgClass, uint8_t msg, void *pData, size_t *pSize, size_t maxSize, uint32_t timeOut)
 
SbgErrorCode sbgEComSendAck (SbgEComHandle *pHandle, uint8_t msgClass, uint8_t msg, SbgErrorCode cmdError)
 
SbgErrorCode sbgEComWaitForAck (SbgEComHandle *pHandle, uint8_t msgClass, uint8_t msg, uint32_t timeOut)
 

Function Documentation

◆ sbgEComCmdGenericGetModelId()

SbgErrorCode sbgEComCmdGenericGetModelId ( SbgEComHandle pHandle,
uint8_t  msgClass,
uint8_t  msg,
uint32_t *  pModelId 
)

Generic function to get an error model ID

Parameters
[in]pHandleA valid sbgECom handle.
[in]msgClassOriginal message class
[in]msgOriginal message ID
[out]pModelIdReturns the currently used model ID.
Returns
SBG_NO_ERROR if the command has been executed successfully.

Definition at line 446 of file sbgEComCmdCommon.c.

◆ sbgEComCmdGenericGetModelInfo()

SbgErrorCode sbgEComCmdGenericGetModelInfo ( SbgEComHandle pHandle,
uint8_t  msgClass,
uint8_t  msg,
SbgEComModelInfo pModelInfo 
)

Generic function to retrieve error model information.

Parameters
[in]pHandleA valid sbgECom handle.
[in]msgClassOriginal message class
[in]msgOriginal message ID
[out]pMotionProfileInfoPointer to a SbgEComModelInfo to contain model info.
Returns
SBG_NO_ERROR if the command has been executed successfully.

Definition at line 512 of file sbgEComCmdCommon.c.

◆ sbgEComCmdGenericSetModelId()

SbgErrorCode sbgEComCmdGenericSetModelId ( SbgEComHandle pHandle,
uint8_t  msgClass,
uint8_t  msg,
uint32_t  modelId 
)

Generic function to set an error model ID

Parameters
[in]pHandleA valid sbgECom handle.
[in]msgClassOriginal message class
[in]msgOriginal message ID
[in]modelIdModel ID to set
Returns
SBG_NO_ERROR if the command has been executed successfully.

Definition at line 380 of file sbgEComCmdCommon.c.

◆ sbgEComReceiveAnyCmd()

SbgErrorCode sbgEComReceiveAnyCmd ( SbgEComHandle pHandle,
uint8_t *  pMsgClass,
uint8_t *  pMsg,
void *  pData,
size_t *  pSize,
size_t  maxSize,
uint32_t  timeOut 
)

Wait until any command that is not a output log is recevied during a specific time out. All binary logs received during this time are handled trough the standard callback system.

Parameters
[in]pHandleA valid sbgECom handle.
[out]pMsgClassPointer used to hold the received command class.
[out]pMsgPointer used to hold the received command ID.
[out]pDataAllocated buffer used to hold received data field.
[out]pSizePointer used to hold the received data field size.
[in]maxSizeMax number of bytes that can be stored in the pData buffer.
[in]timeOutTime out in ms during which we can receive the command.
Returns
SBG_NO_ERROR if we have received a valid frame.
SBG_NOT_READY if we haven't received a valid frame or if the serial buffer is empty.
SBG_INVALID_CRC if the received frame has an invalid CRC.
SBG_NULL_POINTER if an input parameter is NULL.
SBG_BUFFER_OVERFLOW if the received frame payload couldn't fit into the pData buffer. SBG_TIME_OUT if the command hasn't been received withint the specified time out.

Definition at line 25 of file sbgEComCmdCommon.c.

◆ sbgEComReceiveCmd()

SbgErrorCode sbgEComReceiveCmd ( SbgEComHandle pHandle,
uint8_t  msgClass,
uint8_t  msg,
void *  pData,
size_t *  pSize,
size_t  maxSize,
uint32_t  timeOut 
)

Wait for a specific command to be received given a time out.
All binary logs received during this time are handled trough the standard callback system.
NACK for the requested command is treated as a negative answer and the corresponding error code is returned to user. In case an ACK is returned, we condider it's an error as well as expected command is not an ACK but regular command.

Parameters
[in]pHandleA valid sbgECom handle.
[out]msgClassCommand class we expect to receive
[out]msgMessage id we expect to receive
[out]pDataAllocated buffer used to hold received data field.
[out]pSizePointer used to hold the received data field size.
[in]maxSizeMax number of bytes that can be stored in the pData buffer.
[in]timeOutTime out in ms during which we can receive the command.
Returns
SBG_NO_ERROR if we have received a valid frame.
Other error codes may come from the function itself, or from the device returning an NACK.

Definition at line 174 of file sbgEComCmdCommon.c.

◆ sbgEComSendAck()

SbgErrorCode sbgEComSendAck ( SbgEComHandle pHandle,
uint8_t  msgClass,
uint8_t  msg,
SbgErrorCode  cmdError 
)

Send an ACK for a specific command with an associated error code.

Parameters
[in]pHandleA valid sbgECom handle.
[in]msgClassThe message class that we want to send
[in]msgThe message ID that we want to send.
[in]cmdErrorThe associated error code.
Returns
SBG_NO_ERROR if the ACK has been sent.

Definition at line 351 of file sbgEComCmdCommon.c.

◆ sbgEComWaitForAck()

SbgErrorCode sbgEComWaitForAck ( SbgEComHandle pHandle,
uint8_t  msgClass,
uint8_t  msg,
uint32_t  timeOut 
)

Wait for an ACK for a specified amount of time.

Parameters
[in]pHandleA valid sbgECom handle.
[in]msgClassThe message class that we want to check
[in]msgThe message ID that we want to check
[in]timeOutTime out in ms during which we can receive the ACK.
Returns
SBG_NO_ERROR if the ACK has been received.

Definition at line 278 of file sbgEComCmdCommon.c.



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