sbgECom Library  5.2.590-stable
Interface SBG Systems IMU/AHRS/INS
Loading...
Searching...
No Matches
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 _SbgEComLogPtpTransport SbgEComLogPtpTransport
 
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  _SbgEComLogPtpTransport {
  SBG_ECOM_LOG_PTP_TRANSPORT_UDP = 0 ,
  SBG_ECOM_LOG_PTP_TRANSPORT_ETHERNET = 1
}
 
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)
 
void sbgEComLogPtpSetState (SbgEComLogPtp *pLogData, SbgEComLogPtpState state)
 
SbgEComLogPtpState sbgEComLogPtpGetState (const SbgEComLogPtp *pLogData)
 
void sbgEComLogPtpSetTransport (SbgEComLogPtp *pLogData, SbgEComLogPtpTransport transport)
 
SbgEComLogPtpTransport sbgEComLogPtpGetTransport (const SbgEComLogPtp *pLogData)
 
void sbgEComLogPtpSetTimeScale (SbgEComLogPtp *pLogData, SbgEComLogPtpTimeScale timeScale)
 
SbgEComLogPtpTimeScale sbgEComLogPtpGetTimeScale (const SbgEComLogPtp *pLogData)
 

Detailed Description

Parse logs used to report device PTP status.

Author
SBG Systems
Date
2024-06-17
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.

◆ SbgEComLogPtpTransport

◆ SbgEComLogPtpTimeScale

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

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.

◆ _SbgEComLogPtpTransport

Transport.

Enumerator
SBG_ECOM_LOG_PTP_TRANSPORT_UDP 

UDP.

SBG_ECOM_LOG_PTP_TRANSPORT_ETHERNET 

Ethernet (IEEE 802.3).

◆ _SbgEComLogPtpTimeScale

Time scales.

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.

◆ sbgEComLogPtpSetState()

void sbgEComLogPtpSetState ( SbgEComLogPtp * pLogData,
SbgEComLogPtpState state )

Set the PTP state.

Parameters
[in]pLogDataLog instance.
[in]stateThe solution state to set.

◆ sbgEComLogPtpGetState()

SbgEComLogPtpState sbgEComLogPtpGetState ( const SbgEComLogPtp * pLogData)

Returns the PTP solution state.

Parameters
[in]pLogDataLog instance.
Returns
The solution state.

◆ sbgEComLogPtpSetTransport()

void sbgEComLogPtpSetTransport ( SbgEComLogPtp * pLogData,
SbgEComLogPtpTransport transport )

Set the PTP transport.

Parameters
[in]pLogDataLog instance.
[in]transportThe solution transport to set.

◆ sbgEComLogPtpGetTransport()

SbgEComLogPtpTransport sbgEComLogPtpGetTransport ( const SbgEComLogPtp * pLogData)

Returns the PTP solution transport.

Parameters
[in]pLogDataLog instance.
Returns
The solution transport.

◆ sbgEComLogPtpSetTimeScale()

void sbgEComLogPtpSetTimeScale ( SbgEComLogPtp * pLogData,
SbgEComLogPtpTimeScale timeScale )

Set the PTP time scale.

Parameters
[in]pLogDataLog instance.
[in]timeScaleThe solution time scale to set.

◆ sbgEComLogPtpGetTimeScale()

SbgEComLogPtpTimeScale sbgEComLogPtpGetTimeScale ( const SbgEComLogPtp * pLogData)

Returns the PTP solution time scale.

Parameters
[in]pLogDataLog instance.
Returns
The solution time scale.