This file groups all common definitions required by all commands. More...
#include "../sbgECom.h"
Go to the source code of this file.
Classes | |
struct | _SbgEComModelInfo |
Macros | |
#define | SBG_ECOM_DEFAULT_CMD_TIME_OUT (500) |
Typedefs | |
typedef enum _SbgEComAxisDirection | SbgEComAxisDirection |
typedef struct _SbgEComModelInfo | SbgEComModelInfo |
typedef enum _SbgEComRejectionMode | SbgEComRejectionMode |
Enumerations | |
enum | _SbgEComAxisDirection { SBG_ECOM_ALIGNMENT_FORWARD = 0, SBG_ECOM_ALIGNMENT_BACKWARD = 1, SBG_ECOM_ALIGNMENT_LEFT = 2, SBG_ECOM_ALIGNMENT_RIGHT = 3, SBG_ECOM_ALIGNMENT_UP = 4, SBG_ECOM_ALIGNMENT_DOWN = 5 } |
enum | _SbgEComRejectionMode { SBG_ECOM_NEVER_ACCEPT_MODE = 0, SBG_ECOM_AUTOMATIC_MODE = 1, SBG_ECOM_ALWAYS_ACCEPT_MODE = 2 } |
Functions | |
SbgErrorCode | sbgEComCmdGenericGetModelInfo (SbgEComHandle *pHandle, uint8 msgClass, uint8 msg, SbgEComModelInfo *pModelInfo) |
SbgErrorCode | sbgEComCmdGenericSetModelId (SbgEComHandle *pHandle, uint8 msgClass, uint8 msg, uint32 modelId) |
SbgErrorCode | sbgEComReceiveAnyCmd (SbgEComHandle *pHandle, uint8 *pMsgClass, uint8 *pMsg, void *pData, size_t *pSize, size_t maxSize, uint32 timeOut) |
SbgErrorCode | sbgEComReceiveCmd (SbgEComHandle *pHandle, uint8 msgClass, uint8 msg, void *pData, size_t *pSize, size_t maxSize, uint32 timeOut) |
SbgErrorCode | sbgEComSendAck (SbgEComHandle *pHandle, uint8 msgClass, uint8 msg, SbgErrorCode cmdError) |
SbgErrorCode | sbgEComWaitForAck (SbgEComHandle *pHandle, uint8 msgClass, uint8 msg, uint32 timeOut) |
This file groups all common definitions required by all commands.
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 sbgEComCmdCommon.h.
#define SBG_ECOM_DEFAULT_CMD_TIME_OUT (500) |
Default time out in ms for commands reception.
Definition at line 29 of file sbgEComCmdCommon.h.
typedef enum _SbgEComAxisDirection SbgEComAxisDirection |
List of all axis directions for modules/sensor alignment.
typedef struct _SbgEComModelInfo SbgEComModelInfo |
Common model information structure. This is used for motion profile or Magnetometer,Gps, or other aiding sensor error model.
typedef enum _SbgEComRejectionMode SbgEComRejectionMode |
List of all rejection modes for aiding inputs.
List of all axis directions for modules/sensor alignment.
Definition at line 44 of file sbgEComCmdCommon.h.
List of all rejection modes for aiding inputs.
Definition at line 34 of file sbgEComCmdCommon.h.
SbgErrorCode sbgEComCmdGenericGetModelInfo | ( | SbgEComHandle * | pHandle, |
uint8 | msgClass, | ||
uint8 | msg, | ||
SbgEComModelInfo * | pModelInfo | ||
) |
Generic function to retrieve error model information.
[in] | pHandle | A valid sbgECom handle. |
[in] | msgClass | Original message class |
[in] | msg | Original message ID |
[out] | pMotionProfileInfo | Pointer to a SbgEComModelInfo to contain model info. |
Definition at line 497 of file sbgEComCmdCommon.c.
SbgErrorCode sbgEComCmdGenericSetModelId | ( | SbgEComHandle * | pHandle, |
uint8 | msgClass, | ||
uint8 | msg, | ||
uint32 | modelId | ||
) |
Generic function to set an error model ID
[in] | pHandle | A valid sbgECom handle. |
[in] | msgClass | Original message class |
[in] | msg | Original message ID |
[out] | modelId | Model ID to use |
Definition at line 419 of file sbgEComCmdCommon.c.
SbgErrorCode sbgEComReceiveAnyCmd | ( | SbgEComHandle * | pHandle, |
uint8 * | pMsgClass, | ||
uint8 * | pMsg, | ||
void * | pData, | ||
size_t * | pSize, | ||
size_t | maxSize, | ||
uint32 | 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.
[in] | pHandle | A valid sbgECom handle. |
[out] | pMsgClass | Pointer used to hold the received command class. |
[out] | pMsg | Pointer used to hold the received command ID. |
[out] | pData | Allocated buffer used to hold received data field. |
[out] | pSize | Pointer used to hold the received data field size. |
[in] | maxSize | Max number of bytes that can be stored in the pData buffer. |
[in] | timeOut | Time out in ms during which we can receive the command. |
Definition at line 25 of file sbgEComCmdCommon.c.
SbgErrorCode sbgEComReceiveCmd | ( | SbgEComHandle * | pHandle, |
uint8 | msgClass, | ||
uint8 | msg, | ||
void * | pData, | ||
size_t * | pSize, | ||
size_t | maxSize, | ||
uint32 | 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.
[in] | pHandle | A valid sbgECom handle. |
[out] | msgClass | Command class we expect to receive |
[out] | msg | Message id we expect to receive |
[out] | pData | Allocated buffer used to hold received data field. |
[out] | pSize | Pointer used to hold the received data field size. |
[in] | maxSize | Max number of bytes that can be stored in the pData buffer. |
[in] | timeOut | Time out in ms during which we can receive the command. |
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.
[in] | pHandle | A valid sbgECom handle. |
[out] | msgClass | Command class we expect to receive |
[out] | msg | Message id we expect to receive |
[out] | pData | Allocated buffer used to hold received data field. |
[out] | pSize | Pointer used to hold the received data field size. |
[in] | maxSize | Max number of bytes that can be stored in the pData buffer. |
[in] | timeOut | Time out in ms during which we can receive the command. |
Definition at line 191 of file sbgEComCmdCommon.c.
SbgErrorCode sbgEComSendAck | ( | SbgEComHandle * | pHandle, |
uint8 | msgClass, | ||
uint8 | msg, | ||
SbgErrorCode | cmdError | ||
) |
Send an ACK for a specific command with an associated error code.
[in] | pHandle | A valid sbgECom handle. |
[in] | msgClass | The message class that we want to send |
[in] | msg | The message ID that we want to send. |
[in] | cmdError | The associated error code. |
Definition at line 379 of file sbgEComCmdCommon.c.
SbgErrorCode sbgEComWaitForAck | ( | SbgEComHandle * | pHandle, |
uint8 | msgClass, | ||
uint8 | msg, | ||
uint32 | timeOut | ||
) |
Wait for an ACK for a specified amount of time.
[in] | pHandle | A valid sbgECom handle. |
[in] | msgClass | The message class that we want to check |
[in] | msg | The message ID that we want to check |
[in] | timeOut | Time out in ms during which we can receive the ACK. |
Definition at line 303 of file sbgEComCmdCommon.c.