sbgECom  1.11.920-stable
Data Structures | Macros | Typedefs | Enumerations | Functions
sbgEComCmdCommon.h File Reference

This file groups all common definitions required by all commands. More...

#include "../sbgECom.h"

Go to the source code of this file.

Data Structures

struct  _SbgEComModelInfo
 

Macros

#define SBG_ECOM_DEFAULT_CMD_TIME_OUT   (500)
 

Typedefs

typedef enum _SbgEComRejectionMode SbgEComRejectionMode
 
typedef enum _SbgEComAxisDirection SbgEComAxisDirection
 
typedef struct _SbgEComModelInfo SbgEComModelInfo
 

Enumerations

enum  _SbgEComRejectionMode {
  SBG_ECOM_NEVER_ACCEPT_MODE = 0,
  SBG_ECOM_AUTOMATIC_MODE = 1,
  SBG_ECOM_ALWAYS_ACCEPT_MODE = 2
}
 
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
}
 

Functions

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 sbgEComWaitForAck (SbgEComHandle *pHandle, uint8_t msgClass, uint8_t msg, uint32_t timeOut)
 
SbgErrorCode sbgEComSendAck (SbgEComHandle *pHandle, uint8_t msgClass, uint8_t msg, SbgErrorCode cmdError)
 
SbgErrorCode sbgEComCmdGenericSetModelId (SbgEComHandle *pHandle, uint8_t msgClass, uint8_t msg, uint32_t modelId)
 
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)
 

Detailed Description

This file groups all common definitions required by all commands.

Author
SBG Systems (Maxime Renaudet)
Date
11 June 2014

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.

Macro Definition Documentation

§ SBG_ECOM_DEFAULT_CMD_TIME_OUT

#define SBG_ECOM_DEFAULT_CMD_TIME_OUT   (500)

Default time out in ms for commands reception.

Typedef Documentation

§ SbgEComRejectionMode

List of all rejection modes for aiding inputs.

§ SbgEComAxisDirection

List of all axis directions for modules/sensor alignment.

§ SbgEComModelInfo

Common model information structure. This is used for motion profile or Magnetometer,Gps, or other aiding sensor error model.

Enumeration Type Documentation

§ _SbgEComRejectionMode

List of all rejection modes for aiding inputs.

Enumerator
SBG_ECOM_NEVER_ACCEPT_MODE 

Measurement is not taken into account.

SBG_ECOM_AUTOMATIC_MODE 

Measurement is accepted and rejected automatically depending on consistency checks

SBG_ECOM_ALWAYS_ACCEPT_MODE 

Measurement is always accepted. Should be used with caution

§ _SbgEComAxisDirection

List of all axis directions for modules/sensor alignment.

Enumerator
SBG_ECOM_ALIGNMENT_FORWARD 

IMU/module Axis is turned in vehicle's forward direction.

SBG_ECOM_ALIGNMENT_BACKWARD 

IMU/module Axis is turned in vehicle's backward direction.

SBG_ECOM_ALIGNMENT_LEFT 

IMU/module Axis is turned in vehicle's left direction.

SBG_ECOM_ALIGNMENT_RIGHT 

IMU/module Axis is turned in vehicle's right direction.

SBG_ECOM_ALIGNMENT_UP 

IMU/module Axis is turned in vehicle's up direction.

SBG_ECOM_ALIGNMENT_DOWN 

IMU/module Axis is turned in vehicle's down direction.

Function Documentation

§ 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.

§ 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.

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.
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.

§ 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.

§ 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.

§ 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.

§ 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.

§ 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.