sbgECom Library  4.0.1987-stable
C library to interface SBG Systems IMU/AHRS/INS
sbgEComLogStatus.h File Reference

Parse logs used to report device status. More...

Go to the source code of this file.

Data Structures

struct  _SbgEComLogStatus
 

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_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_COM2_ETH0_RX_OK   (0x0001u << 0)
 
#define SBG_ECOM_COM2_ETH0_TX_OK   (0x0001u << 1)
 
#define SBG_ECOM_COM2_ETH1_RX_OK   (0x0001u << 2)
 
#define SBG_ECOM_COM2_ETH1_TX_OK   (0x0001u << 3)
 
#define SBG_ECOM_COM2_ETH2_RX_OK   (0x0001u << 4)
 
#define SBG_ECOM_COM2_ETH2_TX_OK   (0x0001u << 5)
 
#define SBG_ECOM_COM2_ETH3_RX_OK   (0x0001u << 6)
 
#define SBG_ECOM_COM2_ETH3_TX_OK   (0x0001u << 7)
 
#define SBG_ECOM_COM2_ETH4_RX_OK   (0x0001u << 8)
 
#define SBG_ECOM_COM2_ETH4_TX_OK   (0x0001u << 9)
 
#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 _SbgEComLogStatus SbgEComLogStatus
 

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

SbgErrorCode sbgEComLogStatusReadFromStream (SbgEComLogStatus *pLogData, SbgStreamBuffer *pStreamBuffer)
 
SbgErrorCode sbgEComLogStatusWriteToStream (const SbgEComLogStatus *pLogData, SbgStreamBuffer *pStreamBuffer)
 
void sbgEComLogStatusSetCanBusStatus (SbgEComLogStatus *pLogData, SbgEComCanBusStatus status)
 
SbgEComCanBusStatus sbgEComLogStatusGetCanBusStatus (const SbgEComLogStatus *pLogData)
 

Detailed Description

Parse logs used to report device status.

Author
SBG Systems
Date
03 April 2013
License

The MIT license

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Macro Definition Documentation

◆ SBG_ECOM_GENERAL_MAIN_POWER_OK

#define SBG_ECOM_GENERAL_MAIN_POWER_OK   (0x0001u << 0)

Set to 1 when main power supply is OK.

◆ SBG_ECOM_GENERAL_IMU_POWER_OK

#define SBG_ECOM_GENERAL_IMU_POWER_OK   (0x0001u << 1)

Set to 1 when IMU power supply is OK.

◆ SBG_ECOM_GENERAL_GPS_POWER_OK

#define SBG_ECOM_GENERAL_GPS_POWER_OK   (0x0001u << 2)

Set to 1 when GPS power supply is OK.

◆ SBG_ECOM_GENERAL_SETTINGS_OK

#define SBG_ECOM_GENERAL_SETTINGS_OK   (0x0001u << 3)

Set to 1 if settings where correctly loaded.

◆ SBG_ECOM_GENERAL_TEMPERATURE_OK

#define SBG_ECOM_GENERAL_TEMPERATURE_OK   (0x0001u << 4)

Set to 1 when temperature is within specified limits.

◆ SBG_ECOM_GENERAL_DATALOGGER_OK

#define SBG_ECOM_GENERAL_DATALOGGER_OK   (0x0001u << 5)

Set to 1 when the datalogger is working correctly.

◆ SBG_ECOM_GENERAL_CPU_OK

#define SBG_ECOM_GENERAL_CPU_OK   (0x0001u << 6)

Set to 1 if the CPU headroom is correct.

◆ SBG_ECOM_PORTA_VALID

#define SBG_ECOM_PORTA_VALID   (0x00000001u << 0)

Communication status bit mask definitions (comStatus). Set to 0 in case of low level communication error.

◆ SBG_ECOM_PORTB_VALID

#define SBG_ECOM_PORTB_VALID   (0x00000001u << 1)

Set to 0 in case of low level communication error.

◆ SBG_ECOM_PORTC_VALID

#define SBG_ECOM_PORTC_VALID   (0x00000001u << 2)

Set to 0 in case of low level communication error.

◆ SBG_ECOM_PORTD_VALID

#define SBG_ECOM_PORTD_VALID   (0x00000001u << 3)

Set to 0 in case of low level communication error.

◆ SBG_ECOM_PORTE_VALID

#define SBG_ECOM_PORTE_VALID   (0x00000001u << 4)

Set to 0 in case of low level communication error.

◆ SBG_ECOM_PORTA_RX_OK

#define SBG_ECOM_PORTA_RX_OK   (0x00000001u << 5)

Set to 0 in case of error on PORT A input.

◆ SBG_ECOM_PORTA_TX_OK

#define SBG_ECOM_PORTA_TX_OK   (0x00000001u << 6)

Set to 0 in case of error on PORT A output.

◆ SBG_ECOM_PORTB_RX_OK

#define SBG_ECOM_PORTB_RX_OK   (0x00000001u << 7)

Set to 0 in case of error on PORT B input.

◆ SBG_ECOM_PORTB_TX_OK

#define SBG_ECOM_PORTB_TX_OK   (0x00000001u << 8)

Set to 0 in case of error on PORT B output.

◆ SBG_ECOM_PORTC_RX_OK

#define SBG_ECOM_PORTC_RX_OK   (0x00000001u << 9)

Set to 0 in case of error on PORT C input.

◆ SBG_ECOM_PORTC_TX_OK

#define SBG_ECOM_PORTC_TX_OK   (0x00000001u << 10)

Set to 0 in case of error on PORT C output.

◆ SBG_ECOM_PORTD_RX_OK

#define SBG_ECOM_PORTD_RX_OK   (0x00000001u << 11)

Set to 0 in case of error on PORT D input.

◆ SBG_ECOM_PORTD_TX_OK

#define SBG_ECOM_PORTD_TX_OK   (0x00000001u << 12)

Set to 0 in case of error on PORT D input.

◆ SBG_ECOM_PORTE_RX_OK

#define SBG_ECOM_PORTE_RX_OK   (0x00000001u << 13)

Set to 0 in case of error on PORT E input.

◆ SBG_ECOM_PORTE_TX_OK

#define SBG_ECOM_PORTE_TX_OK   (0x00000001u << 14)

Set to 0 in case of error on PORT D input.

◆ SBG_ECOM_ETH0_VALID

#define SBG_ECOM_ETH0_VALID   (0x00000001u << 15)

Set to 0 in case of error on ETH0.

◆ SBG_ECOM_ETH1_VALID

#define SBG_ECOM_ETH1_VALID   (0x00000001u << 16)

Set to 0 in case of error on ETH1.

◆ SBG_ECOM_ETH2_VALID

#define SBG_ECOM_ETH2_VALID   (0x00000001u << 17)

Set to 0 in case of error on ETH2.

◆ SBG_ECOM_ETH3_VALID

#define SBG_ECOM_ETH3_VALID   (0x00000001u << 18)

Set to 0 in case of error on ETH3.

◆ SBG_ECOM_ETH4_VALID

#define SBG_ECOM_ETH4_VALID   (0x00000001u << 19)

Set to 0 in case of error on ETH4.

◆ SBG_ECOM_CAN_VALID

#define SBG_ECOM_CAN_VALID   (0x00000001u << 25)

Set to 0 in case of low level communication error.

◆ SBG_ECOM_CAN_RX_OK

#define SBG_ECOM_CAN_RX_OK   (0x00000001u << 26)

Set to 0 in case of error on CAN Bus input buffer.

◆ SBG_ECOM_CAN_TX_OK

#define SBG_ECOM_CAN_TX_OK   (0x00000001u << 27)

Set to 0 in case of error on CAN Bus output buffer.

◆ SBG_ECOM_COM2_ETH0_RX_OK

#define SBG_ECOM_COM2_ETH0_RX_OK   (0x0001u << 0)

Second communication status bit mask definitions (comStatus2). Set to 0 in case of error on ETH0 input.

◆ SBG_ECOM_COM2_ETH0_TX_OK

#define SBG_ECOM_COM2_ETH0_TX_OK   (0x0001u << 1)

Set to 0 in case of error on ETH0 output.

◆ SBG_ECOM_COM2_ETH1_RX_OK

#define SBG_ECOM_COM2_ETH1_RX_OK   (0x0001u << 2)

Set to 0 in case of error on ETH1 input.

◆ SBG_ECOM_COM2_ETH1_TX_OK

#define SBG_ECOM_COM2_ETH1_TX_OK   (0x0001u << 3)

Set to 0 in case of error on ETH1 output.

◆ SBG_ECOM_COM2_ETH2_RX_OK

#define SBG_ECOM_COM2_ETH2_RX_OK   (0x0001u << 4)

Set to 0 in case of error on ETH2 input.

◆ SBG_ECOM_COM2_ETH2_TX_OK

#define SBG_ECOM_COM2_ETH2_TX_OK   (0x0001u << 5)

Set to 0 in case of error on ETH2 output.

◆ SBG_ECOM_COM2_ETH3_RX_OK

#define SBG_ECOM_COM2_ETH3_RX_OK   (0x0001u << 6)

Set to 0 in case of error on ETH3 input.

◆ SBG_ECOM_COM2_ETH3_TX_OK

#define SBG_ECOM_COM2_ETH3_TX_OK   (0x0001u << 7)

Set to 0 in case of error on ETH3 output.

◆ SBG_ECOM_COM2_ETH4_RX_OK

#define SBG_ECOM_COM2_ETH4_RX_OK   (0x0001u << 8)

Set to 0 in case of error on ETH4 input.

◆ SBG_ECOM_COM2_ETH4_TX_OK

#define SBG_ECOM_COM2_ETH4_TX_OK   (0x0001u << 9)

Set to 0 in case of error on ETH4 output.

◆ SBG_ECOM_AIDING_GPS1_POS_RECV

#define SBG_ECOM_AIDING_GPS1_POS_RECV   (0x00000001u << 0)

Set to 1 when valid GPS 1 position data is received.

◆ SBG_ECOM_AIDING_GPS1_VEL_RECV

#define SBG_ECOM_AIDING_GPS1_VEL_RECV   (0x00000001u << 1)

Set to 1 when valid GPS 1 velocity data is received.

◆ SBG_ECOM_AIDING_GPS1_HDT_RECV

#define SBG_ECOM_AIDING_GPS1_HDT_RECV   (0x00000001u << 2)

Set to 1 when valid GPS 1 true heading data is received.

◆ SBG_ECOM_AIDING_GPS1_UTC_RECV

#define SBG_ECOM_AIDING_GPS1_UTC_RECV   (0x00000001u << 3)

Set to 1 when valid GPS 1 UTC time data is received.

◆ SBG_ECOM_AIDING_GPS2_POS_RECV

#define SBG_ECOM_AIDING_GPS2_POS_RECV   (0x00000001u << 4)

Set to 1 when valid GPS 2 position data is received.

◆ SBG_ECOM_AIDING_GPS2_VEL_RECV

#define SBG_ECOM_AIDING_GPS2_VEL_RECV   (0x00000001u << 5)

Set to 1 when valid GPS 2 velocity data is received.

◆ SBG_ECOM_AIDING_GPS2_HDT_RECV

#define SBG_ECOM_AIDING_GPS2_HDT_RECV   (0x00000001u << 6)

Set to 1 when valid GPS 2 true heading data is received.

◆ SBG_ECOM_AIDING_GPS2_UTC_RECV

#define SBG_ECOM_AIDING_GPS2_UTC_RECV   (0x00000001u << 7)

Set to 1 when valid GPS 2 UTC time data is received.

◆ SBG_ECOM_AIDING_MAG_RECV

#define SBG_ECOM_AIDING_MAG_RECV   (0x00000001u << 8)

Set to 1 when valid Magnetometer data is received.

◆ SBG_ECOM_AIDING_ODO_RECV

#define SBG_ECOM_AIDING_ODO_RECV   (0x00000001u << 9)

Set to 1 when Odometer pulse is received.

◆ SBG_ECOM_AIDING_DVL_RECV

#define SBG_ECOM_AIDING_DVL_RECV   (0x00000001u << 10)

Set to 1 when valid DVL data is received.

◆ SBG_ECOM_AIDING_USBL_RECV

#define SBG_ECOM_AIDING_USBL_RECV   (0x00000001u << 11)

Set to 1 when valid USBL data is received.

◆ SBG_ECOM_AIDING_DEPTH_RECV

#define SBG_ECOM_AIDING_DEPTH_RECV   (0x00000001u << 12)

Set to 1 when valid Depth Log data is received.

◆ SBG_ECOM_AIDING_AIR_DATA_RECV

#define SBG_ECOM_AIDING_AIR_DATA_RECV   (0x00000001u << 13)

Set to 1 when valid Air Data (altitude and/or true airspeed) is received.

◆ SBG_ECOM_AIDING_USER_POS_RECV

#define SBG_ECOM_AIDING_USER_POS_RECV   (0x00000001u << 14)

Set to 1 when valid user position data is received.

◆ SBG_ECOM_AIDING_USER_VEL_RECV

#define SBG_ECOM_AIDING_USER_VEL_RECV   (0x00000001u << 15)

Set to 1 when valid user velocity data is received.

◆ SBG_ECOM_AIDING_USER_HEADING_RECV

#define SBG_ECOM_AIDING_USER_HEADING_RECV   (0x00000001u << 16)

Set to 1 when valid user heading data is received.

Typedef Documentation

◆ SbgEComCanBusStatus

Communication status for the CAN Bus.

◆ SbgEComLogStatus

Stores global status data.

Enumeration Type Documentation

◆ _SbgEComCanBusStatus

Communication status for the CAN Bus.

Enumerator
SBG_ECOM_CAN_BUS_OFF 

CAN bus is OFF (either not enabled or disabled due to too much errors).

SBG_ECOM_CAN_BUS_TX_RX_ERR 

CAN bus transmitter or receiver has error.

SBG_ECOM_CAN_BUS_OK 

CAN Bus is OK.

SBG_ECOM_CAN_BUS_ERROR 

CAN Bus has a general error such as busy bus.

Function Documentation

◆ sbgEComLogStatusReadFromStream()

SbgErrorCode sbgEComLogStatusReadFromStream ( SbgEComLogStatus pLogData,
SbgStreamBuffer pStreamBuffer 
)

Parse data for the SBG_ECOM_LOG_STATUS message and fill the corresponding structure.

Parameters
[out]pLogDataLog structure instance to fill.
[in]pStreamBufferInput stream buffer to read the log from.
Returns
SBG_NO_ERROR if a valid log has been read from the stream buffer.

◆ sbgEComLogStatusWriteToStream()

SbgErrorCode sbgEComLogStatusWriteToStream ( const SbgEComLogStatus pLogData,
SbgStreamBuffer pStreamBuffer 
)

Write data for the SBG_ECOM_LOG_STATUS message to the output stream buffer from the provided structure.

Parameters
[in]pLogDataLog structure instance to write.
[out]pStreamBufferOutput stream buffer to write the log to.
Returns
SBG_NO_ERROR if the log has been written to the stream buffer.

◆ sbgEComLogStatusSetCanBusStatus()

void sbgEComLogStatusSetCanBusStatus ( SbgEComLogStatus pLogData,
SbgEComCanBusStatus  status 
)

Defines the CAN bus status.

Parameters
[out]pLogDataLog status instance.
[in]statusCAN bus status to set.

◆ sbgEComLogStatusGetCanBusStatus()

SbgEComCanBusStatus sbgEComLogStatusGetCanBusStatus ( const SbgEComLogStatus pLogData)

Returns the CAN bus status.

Parameters
[in]pLogDataLog status instance.
Returns
CAN bus status.