sbgECom Library  5.1.708-stable
Interface SBG Systems IMU/AHRS/INS
sbgEComLogPtp.h File Reference

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

Go to the source code of this file.

Data Structures

struct  _SbgEComLogPtp
 

Typedefs

typedef enum _SbgEComLogPtpState SbgEComLogPtpState
 
typedef enum _SbgEComLogPtpTimeScale SbgEComLogPtpTimeScale
 
typedef struct _SbgEComLogPtp SbgEComLogPtp
 

Enumerations

enum  _SbgEComLogPtpState {
  SBG_ECOM_LOG_PTP_STATE_DISABLED = 0 ,
  SBG_ECOM_LOG_PTP_STATE_FAULTY = 1 ,
  SBG_ECOM_LOG_PTP_STATE_MASTER = 2 ,
  SBG_ECOM_LOG_PTP_STATE_PASSIVE = 3
}
 
enum  _SbgEComLogPtpTimeScale {
  SBG_ECOM_LOG_PTP_TIME_SCALE_TAI = 0 ,
  SBG_ECOM_LOG_PTP_TIME_SCALE_UTC = 1 ,
  SBG_ECOM_LOG_PTP_TIME_SCALE_GPS = 2
}
 

Functions

void sbgEComLogPtpZeroInit (SbgEComLogPtp *pLogData)
 
SbgErrorCode sbgEComLogPtpReadFromStream (SbgEComLogPtp *pLogData, SbgStreamBuffer *pStreamBuffer)
 
SbgErrorCode sbgEComLogPtpWriteToStream (const SbgEComLogPtp *pLogData, SbgStreamBuffer *pStreamBuffer)
 

Detailed Description

Parse logs used to report device PTP status.

Author
SBG Systems
Date
Monday 17, 2024
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

◆ SbgEComLogPtpState

PTP states.

These are on-the-wire values.

◆ SbgEComLogPtpTimeScale

Time scales.

These are on-the-wire values.

◆ SbgEComLogPtp

typedef struct _SbgEComLogPtp SbgEComLogPtp

Structure that stores data for the SBG_ECOM_LOG_PTP_STATUS message.

The local clock members are valid only if the local clock identity is valid. Similarly, the master clock members are valid only if the master clock identity is valid.

The mean path delay, clock offset, and clock frequency offset, as well as their standard deviations, are set to NAN if invalid or unknown.

Enumeration Type Documentation

◆ _SbgEComLogPtpState

PTP states.

These are on-the-wire values.

Enumerator
SBG_ECOM_LOG_PTP_STATE_DISABLED 

PTP is disabled.

SBG_ECOM_LOG_PTP_STATE_FAULTY 

The device is in the faulty state.

SBG_ECOM_LOG_PTP_STATE_MASTER 

The device is the domain master.

SBG_ECOM_LOG_PTP_STATE_PASSIVE 

The device is passive.

◆ _SbgEComLogPtpTimeScale

Time scales.

These are on-the-wire values.

Enumerator
SBG_ECOM_LOG_PTP_TIME_SCALE_TAI 

TAI.

SBG_ECOM_LOG_PTP_TIME_SCALE_UTC 

UTC.

SBG_ECOM_LOG_PTP_TIME_SCALE_GPS 

GPS.

Function Documentation

◆ sbgEComLogPtpZeroInit()

void sbgEComLogPtpZeroInit ( SbgEComLogPtp pLogData)

Zero initialize the message struct.

Parameters
[out]pLogDataStructure instance to zero init.

◆ sbgEComLogPtpReadFromStream()

SbgErrorCode sbgEComLogPtpReadFromStream ( SbgEComLogPtp pLogData,
SbgStreamBuffer pStreamBuffer 
)

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

◆ sbgEComLogPtpWriteToStream()

SbgErrorCode sbgEComLogPtpWriteToStream ( const SbgEComLogPtp pLogData,
SbgStreamBuffer pStreamBuffer 
)

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