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

Parse logs used to report device UTC time. More...

Go to the source code of this file.

Data Structures

struct  _SbgEComLogUtc
 

Typedefs

typedef enum _SbgEComClockState SbgEComClockState
 
typedef enum _SbgEComUtcStatus SbgEComUtcStatus
 
typedef struct _SbgEComLogUtc SbgEComLogUtc
 

Enumerations

enum  _SbgEComClockState {
  SBG_ECOM_CLOCK_STATE_ERROR = 0 ,
  SBG_ECOM_CLOCK_STATE_FREE_RUNNING = 1 ,
  SBG_ECOM_CLOCK_STATE_STEERING = 2 ,
  SBG_ECOM_CLOCK_STATE_VALID = 3
}
 
enum  _SbgEComUtcStatus {
  SBG_ECOM_UTC_STATUS_INVALID = 0 ,
  SBG_ECOM_UTC_STATUS_NO_LEAP_SEC = 1 ,
  SBG_ECOM_UTC_STATUS_INITIALIZED = 2
}
 

Functions

void sbgEComLogUtcZeroInit (SbgEComLogUtc *pLogData)
 
SbgErrorCode sbgEComLogUtcReadFromStream (SbgEComLogUtc *pLogData, SbgStreamBuffer *pStreamBuffer)
 
SbgErrorCode sbgEComLogUtcWriteToStream (const SbgEComLogUtc *pLogData, SbgStreamBuffer *pStreamBuffer)
 
void sbgEComLogUtcSetClockState (SbgEComLogUtc *pLogData, SbgEComClockState state)
 
SbgEComClockState sbgEComLogUtcGetClockState (const SbgEComLogUtc *pLogData)
 
const char * sbgEComLogUtcGetClockStateAsString (const SbgEComLogUtc *pLogData)
 
void sbgEComLogUtcSetUtcStatus (SbgEComLogUtc *pLogData, SbgEComUtcStatus status)
 
SbgEComUtcStatus sbgEComLogUtcGetUtcStatus (const SbgEComLogUtc *pLogData)
 
const char * sbgEComLogUtcGetUtcStatusAsString (const SbgEComLogUtc *pLogData)
 
void sbgEComLogUtcSetHasClockInput (SbgEComLogUtc *pLogData, bool hasClockInput)
 
bool sbgEComLogUtcHasClockInput (const SbgEComLogUtc *pLogData)
 
void sbgEComLogUtcTimeSetIsAccurate (SbgEComLogUtc *pLogData, bool utcIsAccurate)
 
bool sbgEComLogUtcTimeIsAccurate (const SbgEComLogUtc *pLogData)
 
bool sbgEComLogUtcTimeClkBiasStdIsValid (const SbgEComLogUtc *pLogData)
 
bool sbgEComLogUtcTimeClkSfErrorStdIsValid (const SbgEComLogUtc *pLogData)
 
bool sbgEComLogUtcTimeClkResidualErrorIsValid (const SbgEComLogUtc *pLogData)
 

Detailed Description

Parse logs used to report device UTC time.

Author
SBG Systems
Date
20 February 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.

Typedef Documentation

◆ SbgEComClockState

Internal clock alignment to PPS algorithm state.

◆ SbgEComUtcStatus

Status for the GNSS UTC time information.

◆ SbgEComLogUtc

typedef struct _SbgEComLogUtc SbgEComLogUtc

Structure that stores data for the SBG_ECOM_LOG_UTC_TIME message.

Enumeration Type Documentation

◆ _SbgEComClockState

Internal clock alignment to PPS algorithm state.

Enumerator
SBG_ECOM_CLOCK_STATE_ERROR 

An error has occurred on the clock estimation.

SBG_ECOM_CLOCK_STATE_FREE_RUNNING 

The clock is only based on the internal crystal using latest known clock bias and scale factor.

SBG_ECOM_CLOCK_STATE_STEERING 

A PPS has been detected and the clock is converging to it.

SBG_ECOM_CLOCK_STATE_VALID 

The internal clock is converged to the PPS signal or is still considered to be accurate.

◆ _SbgEComUtcStatus

Status for the GNSS UTC time information.

Enumerator
SBG_ECOM_UTC_STATUS_INVALID 

UTC time is not known and invalid. The INS uses the firmware default initial date/time.

SBG_ECOM_UTC_STATUS_NO_LEAP_SEC 

UTC time is initialized but the leap second is not known - the default firmware value is used.

SBG_ECOM_UTC_STATUS_INITIALIZED 

UTC time is initialized with a fully resolved leap second information.

Function Documentation

◆ sbgEComLogUtcZeroInit()

void sbgEComLogUtcZeroInit ( SbgEComLogUtc pLogData)

Zero initialize the message struct.

Parameters
[out]pLogDataStructure instance to zero init.

◆ sbgEComLogUtcReadFromStream()

SbgErrorCode sbgEComLogUtcReadFromStream ( SbgEComLogUtc pLogData,
SbgStreamBuffer pStreamBuffer 
)

Parse data for the SBG_ECOM_LOG_UTC_DATA 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.

◆ sbgEComLogUtcWriteToStream()

SbgErrorCode sbgEComLogUtcWriteToStream ( const SbgEComLogUtc pLogData,
SbgStreamBuffer pStreamBuffer 
)

Write data for the SBG_ECOM_LOG_UTC_DATA 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.

◆ sbgEComLogUtcSetClockState()

void sbgEComLogUtcSetClockState ( SbgEComLogUtc pLogData,
SbgEComClockState  state 
)

Set the clock alignment state.

Parameters
[in]pLogDataLog instance.
[in]stateThe status to set.

◆ sbgEComLogUtcGetClockState()

SbgEComClockState sbgEComLogUtcGetClockState ( const SbgEComLogUtc pLogData)

Returns the clock alignment state.

Parameters
[in]pLogDataLog instance.
Returns
The clock status.

◆ sbgEComLogUtcGetClockStateAsString()

const char* sbgEComLogUtcGetClockStateAsString ( const SbgEComLogUtc pLogData)

Returns the clock alignment state as a NULL terminated C string.

Parameters
[in]pLogDataLog instance.
Returns
The clock state as a C string.

◆ sbgEComLogUtcSetUtcStatus()

void sbgEComLogUtcSetUtcStatus ( SbgEComLogUtc pLogData,
SbgEComUtcStatus  status 
)

Set the UTC time information status.

Parameters
[in]pLogDataLog instance.
[in]statusThe status to set.

◆ sbgEComLogUtcGetUtcStatus()

SbgEComUtcStatus sbgEComLogUtcGetUtcStatus ( const SbgEComLogUtc pLogData)

Returns the GNSS UTC time information status.

Parameters
[in]pLogDataLog instance.
Returns
The UTC time information status.

◆ sbgEComLogUtcGetUtcStatusAsString()

const char* sbgEComLogUtcGetUtcStatusAsString ( const SbgEComLogUtc pLogData)

Returns the GNSS UTC time information status as a NULL terminated C string.

Parameters
[in]pLogDataLog instance.
Returns
The UTC time information status as a C string.

◆ sbgEComLogUtcSetHasClockInput()

void sbgEComLogUtcSetHasClockInput ( SbgEComLogUtc pLogData,
bool  hasClockInput 
)

Set if a valid PPS signal is received and can be used to align the internal clock.

Parameters
[in]pLogDataLog instance.
[in]hasClockInputtrue if a valid PPS signal is received.

◆ sbgEComLogUtcHasClockInput()

bool sbgEComLogUtcHasClockInput ( const SbgEComLogUtc pLogData)

Returns true if a valid and stable PPS signal is being received to align the INS clock.

Use this status to determine if the INS is constantly correcting the clock with a PPS signal or propagating the clock with its internal crystal using latest estimated bias and scale factor corrections.

During nominal INS operations with good GNSS reception, this method should return true. During GNSS outages, no PPS signal is received and this method should return false.

Parameters
[in]pLogDataLog instance.
Returns
true if a valid PPS signal is received and false if no PPS signal is received.

◆ sbgEComLogUtcTimeSetIsAccurate()

void sbgEComLogUtcTimeSetIsAccurate ( SbgEComLogUtc pLogData,
bool  utcIsAccurate 
)

Set if the reported UTC time is accurate or not (ie timestamped with a PPS).

Parameters
[in]pLogDataLog instance.
[in]utcIsAccuratetrue if the UTC time is accurate or false otherwise.

◆ sbgEComLogUtcTimeIsAccurate()

bool sbgEComLogUtcTimeIsAccurate ( const SbgEComLogUtc pLogData)

Returns true if the UTC time information is considered to be accurate.

The PPS signal is used to compensate for processing and transmission delays to precisely timestamp the received UTC time information.

During nominal INS operations with good GNSS reception, this method should return true.

If the PPS signal is lost for too much time, this method should return false indicating a degraded UTC time information accuracy.

Parameters
[in]pLogDataLog instance.
Returns
true if the UTC time information is accurate.

◆ sbgEComLogUtcTimeClkBiasStdIsValid()

bool sbgEComLogUtcTimeClkBiasStdIsValid ( const SbgEComLogUtc pLogData)

Returns true if the clkBiasStd field is filled and valid.

Parameters
[in]pLogDataLog instance.
Returns
true if the field is valid.

◆ sbgEComLogUtcTimeClkSfErrorStdIsValid()

bool sbgEComLogUtcTimeClkSfErrorStdIsValid ( const SbgEComLogUtc pLogData)

Returns true if the clkSfErrorStd field is filled and valid.

Parameters
[in]pLogDataLog instance.
Returns
true if the field is valid.

◆ sbgEComLogUtcTimeClkResidualErrorIsValid()

bool sbgEComLogUtcTimeClkResidualErrorIsValid ( const SbgEComLogUtc pLogData)

Returns true if the clkResidualError field is filled and valid.

Parameters
[in]pLogDataLog instance.
Returns
true if the field is valid.