sbgECom
1.11.920-stable
|
This file is used to parse received device status binary logs. More...
#include <sbgCommon.h>
#include <streamBuffer/sbgStreamBuffer.h>
Go to the source code of this file.
Data Structures | |
struct | _SbgLogStatusData |
Macros | |
#define | SBG_ECOM_GENERAL_MAIN_POWER_OK (0x0001u << 0) |
#define | SBG_ECOM_GENERAL_IMU_POWER_OK (0x0001u << 1) |
#define | SBG_ECOM_GENERAL_GPS_POWER_OK (0x0001u << 2) |
#define | SBG_ECOM_GENERAL_SETTINGS_OK (0x0001u << 3) |
#define | SBG_ECOM_GENERAL_TEMPERATURE_OK (0x0001u << 4) |
#define | SBG_ECOM_GENERAL_DATALOGGER_OK (0x0001u << 5) |
#define | SBG_ECOM_GENERAL_CPU_OK (0x0001u << 6) |
#define | SBG_ECOM_CAN_STATUS_SHIFT (28u) |
#define | SBG_ECOM_CAN_STATUS_MASK (0x00000007u) |
#define | SBG_ECOM_PORTA_VALID (0x00000001u << 0) |
#define | SBG_ECOM_PORTB_VALID (0x00000001u << 1) |
#define | SBG_ECOM_PORTC_VALID (0x00000001u << 2) |
#define | SBG_ECOM_PORTD_VALID (0x00000001u << 3) |
#define | SBG_ECOM_PORTE_VALID (0x00000001u << 4) |
#define | SBG_ECOM_PORTA_RX_OK (0x00000001u << 5) |
#define | SBG_ECOM_PORTA_TX_OK (0x00000001u << 6) |
#define | SBG_ECOM_PORTB_RX_OK (0x00000001u << 7) |
#define | SBG_ECOM_PORTB_TX_OK (0x00000001u << 8) |
#define | SBG_ECOM_PORTC_RX_OK (0x00000001u << 9) |
#define | SBG_ECOM_PORTC_TX_OK (0x00000001u << 10) |
#define | SBG_ECOM_PORTD_RX_OK (0x00000001u << 11) |
#define | SBG_ECOM_PORTD_TX_OK (0x00000001u << 12) |
#define | SBG_ECOM_PORTE_RX_OK (0x00000001u << 13) |
#define | SBG_ECOM_PORTE_TX_OK (0x00000001u << 14) |
#define | SBG_ECOM_ETH0_VALID (0x00000001u << 15) |
#define | SBG_ECOM_ETH1_VALID (0x00000001u << 16) |
#define | SBG_ECOM_ETH2_VALID (0x00000001u << 17) |
#define | SBG_ECOM_ETH3_VALID (0x00000001u << 18) |
#define | SBG_ECOM_ETH4_VALID (0x00000001u << 19) |
#define | SBG_ECOM_CAN_VALID (0x00000001u << 25) |
#define | SBG_ECOM_CAN_RX_OK (0x00000001u << 26) |
#define | SBG_ECOM_CAN_TX_OK (0x00000001u << 27) |
#define | SBG_ECOM_AIDING_GPS1_POS_RECV (0x00000001u << 0) |
#define | SBG_ECOM_AIDING_GPS1_VEL_RECV (0x00000001u << 1) |
#define | SBG_ECOM_AIDING_GPS1_HDT_RECV (0x00000001u << 2) |
#define | SBG_ECOM_AIDING_GPS1_UTC_RECV (0x00000001u << 3) |
#define | SBG_ECOM_AIDING_GPS2_POS_RECV (0x00000001u << 4) |
#define | SBG_ECOM_AIDING_GPS2_VEL_RECV (0x00000001u << 5) |
#define | SBG_ECOM_AIDING_GPS2_HDT_RECV (0x00000001u << 6) |
#define | SBG_ECOM_AIDING_GPS2_UTC_RECV (0x00000001u << 7) |
#define | SBG_ECOM_AIDING_MAG_RECV (0x00000001u << 8) |
#define | SBG_ECOM_AIDING_ODO_RECV (0x00000001u << 9) |
#define | SBG_ECOM_AIDING_DVL_RECV (0x00000001u << 10) |
#define | SBG_ECOM_AIDING_USBL_RECV (0x00000001u << 11) |
#define | SBG_ECOM_AIDING_DEPTH_RECV (0x00000001u << 12) |
#define | SBG_ECOM_AIDING_AIR_DATA_RECV (0x00000001u << 13) |
#define | SBG_ECOM_AIDING_USER_POS_RECV (0x00000001u << 14) |
#define | SBG_ECOM_AIDING_USER_VEL_RECV (0x00000001u << 15) |
#define | SBG_ECOM_AIDING_USER_HEADING_RECV (0x00000001u << 16) |
Typedefs | |
typedef enum _SbgEComCanBusStatus | SbgEComCanBusStatus |
typedef struct _SbgLogStatusData | SbgLogStatusData |
Enumerations | |
enum | _SbgEComCanBusStatus { SBG_ECOM_CAN_BUS_OFF = 0, SBG_ECOM_CAN_BUS_TX_RX_ERR = 1, SBG_ECOM_CAN_BUS_OK = 2, SBG_ECOM_CAN_BUS_ERROR = 3 } |
Functions | |
SBG_INLINE SbgEComCanBusStatus | sbgEComLogStatusGetCanStatus (uint32_t status) |
SBG_INLINE uint32_t | sbgEComLogStatusBuildCommunicationStatus (SbgEComCanBusStatus canStatus, uint32_t masks) |
SbgErrorCode | sbgEComBinaryLogParseStatusData (SbgStreamBuffer *pInputStream, SbgLogStatusData *pOutputData) |
SbgErrorCode | sbgEComBinaryLogWriteStatusData (SbgStreamBuffer *pOutputStream, const SbgLogStatusData *pInputData) |
This file is used to parse received device status binary logs.
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.
#define SBG_ECOM_GENERAL_MAIN_POWER_OK (0x0001u << 0) |
Set to 1 when main power supply is OK.
#define SBG_ECOM_GENERAL_IMU_POWER_OK (0x0001u << 1) |
Set to 1 when IMU power supply is OK.
#define SBG_ECOM_GENERAL_GPS_POWER_OK (0x0001u << 2) |
Set to 1 when GPS power supply is OK.
#define SBG_ECOM_GENERAL_SETTINGS_OK (0x0001u << 3) |
Set to 1 if settings where correctly loaded.
#define SBG_ECOM_GENERAL_TEMPERATURE_OK (0x0001u << 4) |
Set to 1 when temperature is within specified limits.
#define SBG_ECOM_GENERAL_DATALOGGER_OK (0x0001u << 5) |
Set to 1 when the datalogger is working correctly.
#define SBG_ECOM_GENERAL_CPU_OK (0x0001u << 6) |
Set to 1 if the CPU headroom is correct.
#define SBG_ECOM_CAN_STATUS_SHIFT (28u) |
Communication CAN status definitions.Shift used to access the CAN status part.
Referenced by sbgEComLogStatusBuildCommunicationStatus(), and sbgEComLogStatusGetCanStatus().
#define SBG_ECOM_CAN_STATUS_MASK (0x00000007u) |
Mask used to keep only the CAN status part.
Referenced by sbgEComLogStatusBuildCommunicationStatus(), and sbgEComLogStatusGetCanStatus().
#define SBG_ECOM_PORTA_VALID (0x00000001u << 0) |
Communication status bit mask definitions.Set to 0 in case of low level communication error.
#define SBG_ECOM_PORTB_VALID (0x00000001u << 1) |
Set to 0 in case of low level communication error.
#define SBG_ECOM_PORTC_VALID (0x00000001u << 2) |
Set to 0 in case of low level communication error.
#define SBG_ECOM_PORTD_VALID (0x00000001u << 3) |
Set to 0 in case of low level communication error.
#define SBG_ECOM_PORTE_VALID (0x00000001u << 4) |
Set to 0 in case of low level communication error.
#define SBG_ECOM_PORTA_RX_OK (0x00000001u << 5) |
Set to 0 in case of error on PORT A input.
#define SBG_ECOM_PORTA_TX_OK (0x00000001u << 6) |
Set to 0 in case of error on PORT A output.
#define SBG_ECOM_PORTB_RX_OK (0x00000001u << 7) |
Set to 0 in case of error on PORT B input.
#define SBG_ECOM_PORTB_TX_OK (0x00000001u << 8) |
Set to 0 in case of error on PORT B output.
#define SBG_ECOM_PORTC_RX_OK (0x00000001u << 9) |
Set to 0 in case of error on PORT C input.
#define SBG_ECOM_PORTC_TX_OK (0x00000001u << 10) |
Set to 0 in case of error on PORT C output.
#define SBG_ECOM_PORTD_RX_OK (0x00000001u << 11) |
Set to 0 in case of error on PORT D input.
#define SBG_ECOM_PORTD_TX_OK (0x00000001u << 12) |
Set to 0 in case of error on PORT D input.
#define SBG_ECOM_PORTE_RX_OK (0x00000001u << 13) |
Set to 0 in case of error on PORT E input.
#define SBG_ECOM_PORTE_TX_OK (0x00000001u << 14) |
Set to 0 in case of error on PORT D input.
#define SBG_ECOM_ETH0_VALID (0x00000001u << 15) |
Set to 0 in case of error on ETH0.
#define SBG_ECOM_ETH1_VALID (0x00000001u << 16) |
Set to 0 in case of error on ETH1.
#define SBG_ECOM_ETH2_VALID (0x00000001u << 17) |
Set to 0 in case of error on ETH2.
#define SBG_ECOM_ETH3_VALID (0x00000001u << 18) |
Set to 0 in case of error on ETH3.
#define SBG_ECOM_ETH4_VALID (0x00000001u << 19) |
Set to 0 in case of error on ETH4.
#define SBG_ECOM_CAN_VALID (0x00000001u << 25) |
Set to 0 in case of low level communication error.
#define SBG_ECOM_CAN_RX_OK (0x00000001u << 26) |
Set to 0 in case of error on CAN Bus input buffer.
#define SBG_ECOM_CAN_TX_OK (0x00000001u << 27) |
Set to 0 in case of error on CAN Bus output buffer.
#define SBG_ECOM_AIDING_GPS1_POS_RECV (0x00000001u << 0) |
Set to 1 when valid GPS 1 position data is received.
#define SBG_ECOM_AIDING_GPS1_VEL_RECV (0x00000001u << 1) |
Set to 1 when valid GPS 1 velocity data is received.
#define SBG_ECOM_AIDING_GPS1_HDT_RECV (0x00000001u << 2) |
Set to 1 when valid GPS 1 true heading data is received.
#define SBG_ECOM_AIDING_GPS1_UTC_RECV (0x00000001u << 3) |
Set to 1 when valid GPS 1 UTC time data is received.
#define SBG_ECOM_AIDING_GPS2_POS_RECV (0x00000001u << 4) |
Set to 1 when valid GPS 2 position data is received.
#define SBG_ECOM_AIDING_GPS2_VEL_RECV (0x00000001u << 5) |
Set to 1 when valid GPS 2 velocity data is received.
#define SBG_ECOM_AIDING_GPS2_HDT_RECV (0x00000001u << 6) |
Set to 1 when valid GPS 2 true heading data is received.
#define SBG_ECOM_AIDING_GPS2_UTC_RECV (0x00000001u << 7) |
Set to 1 when valid GPS 2 UTC time data is received.
#define SBG_ECOM_AIDING_MAG_RECV (0x00000001u << 8) |
Set to 1 when valid Magnetometer data is received.
#define SBG_ECOM_AIDING_ODO_RECV (0x00000001u << 9) |
Set to 1 when Odometer pulse is received.
#define SBG_ECOM_AIDING_DVL_RECV (0x00000001u << 10) |
Set to 1 when valid DVL data is received.
#define SBG_ECOM_AIDING_USBL_RECV (0x00000001u << 11) |
Set to 1 when valid USBL data is received.
#define SBG_ECOM_AIDING_DEPTH_RECV (0x00000001u << 12) |
Set to 1 when valid Depth Log data is received.
#define SBG_ECOM_AIDING_AIR_DATA_RECV (0x00000001u << 13) |
Set to 1 when valid Air Data (altitude and/or true airspeed) is received.
#define SBG_ECOM_AIDING_USER_POS_RECV (0x00000001u << 14) |
Set to 1 when valid user position data is received.
#define SBG_ECOM_AIDING_USER_VEL_RECV (0x00000001u << 15) |
Set to 1 when valid user velocity data is received.
#define SBG_ECOM_AIDING_USER_HEADING_RECV (0x00000001u << 16) |
Set to 1 when valid user heading data is received.
typedef enum _SbgEComCanBusStatus SbgEComCanBusStatus |
Communication status for the CAN Bus.
typedef struct _SbgLogStatusData SbgLogStatusData |
Stores global status data.
enum _SbgEComCanBusStatus |
SBG_INLINE SbgEComCanBusStatus sbgEComLogStatusGetCanStatus | ( | uint32_t | status | ) |
Method used to read the CAN bus status from a communication status field.
[in] | status | Status field to extract the CAN bus status from it. |
References SBG_ECOM_CAN_STATUS_MASK, and SBG_ECOM_CAN_STATUS_SHIFT.
SBG_INLINE uint32_t sbgEComLogStatusBuildCommunicationStatus | ( | SbgEComCanBusStatus | canStatus, |
uint32_t | masks | ||
) |
Method used to write the CAN bus status field.
[in] | canStatus | The CAN bus status to set. |
[in] | masks | Bit mask to set. |
References SBG_ECOM_CAN_STATUS_MASK, SBG_ECOM_CAN_STATUS_SHIFT, sbgEComBinaryLogParseStatusData(), and sbgEComBinaryLogWriteStatusData().
SbgErrorCode sbgEComBinaryLogParseStatusData | ( | SbgStreamBuffer * | pInputStream, |
SbgLogStatusData * | pOutputData | ||
) |
Parse data for the SBG_ECOM_LOG_STATUS message and fill the corresponding structure.
[in] | pInputStream | Input stream buffer to read the payload from. |
[out] | pOutputData | Pointer on the output structure that stores parsed data. |
Referenced by sbgEComLogStatusBuildCommunicationStatus().
SbgErrorCode sbgEComBinaryLogWriteStatusData | ( | SbgStreamBuffer * | pOutputStream, |
const SbgLogStatusData * | pInputData | ||
) |
Write data for the SBG_ECOM_LOG_STATUS message to the output stream buffer from the provided structure.
[out] | pOutputStream | Output stream buffer to write the payload to. |
[in] | pInputData | Pointer on the input structure that stores data to write. |
Referenced by sbgEComLogStatusBuildCommunicationStatus().