clkmgr 2.0
Clock Manager API library to receive events from the PTP service
Loading...
Searching...
No Matches
Typedefs | Functions
event_c.h File Reference

C wrapper to get clock synchronization events data. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef struct Clkmgr_ClockSyncData Clkmgr_ClockSyncData
 

Functions

Clkmgr_ClockSyncDataclkmgr_constructClockSyncDataInstance (void)
 
void clkmgr_destroyClockSyncDataInstance (Clkmgr_ClockSyncData *data_c)
 
bool clkmgr_havePtpData (const Clkmgr_ClockSyncData *data_c)
 
bool clkmgr_haveSysData (const Clkmgr_ClockSyncData *data_c)
 
int64_t clkmgr_getClockOffset (const Clkmgr_ClockSyncData *data_c, enum Clkmgr_ClockType clock_type)
 
bool clkmgr_isOffsetInRange (const Clkmgr_ClockSyncData *data_c, enum Clkmgr_ClockType clock_type)
 
uint32_t clkmgr_getOffsetInRangeEventCount (const Clkmgr_ClockSyncData *data_c, enum Clkmgr_ClockType clock_type)
 
uint64_t clkmgr_getSyncInterval (const Clkmgr_ClockSyncData *data_c, enum Clkmgr_ClockType clock_type)
 
uint64_t clkmgr_getGmIdentity (const Clkmgr_ClockSyncData *data_c, enum Clkmgr_ClockType clock_type)
 
bool clkmgr_isGmChanged (const Clkmgr_ClockSyncData *data_c, enum Clkmgr_ClockType clock_type)
 
uint32_t clkmgr_getGmChangedEventCount (const Clkmgr_ClockSyncData *data_c, enum Clkmgr_ClockType clock_type)
 
uint64_t clkmgr_getNotificationTimestamp (const Clkmgr_ClockSyncData *data_c, enum Clkmgr_ClockType clock_type)
 
bool clkmgr_isPtpSyncedWithGm (const Clkmgr_ClockSyncData *data_c)
 
uint32_t clkmgr_getPtpSyncedWithGmEventCount (const Clkmgr_ClockSyncData *data_c)
 
bool clkmgr_isPtpAsCapable (const Clkmgr_ClockSyncData *data_c)
 
uint32_t clkmgr_getPtpAsCapableEventCount (const Clkmgr_ClockSyncData *data_c)
 
bool clkmgr_isPtpCompositeEventMet (const Clkmgr_ClockSyncData *data_c)
 
uint32_t clkmgr_getPtpCompositeEventCount (const Clkmgr_ClockSyncData *data_c)
 

Detailed Description

C wrapper to get clock synchronization events data.

Author
Goh Wei Sheng <wei.sheng.goh@intel.com>

Typedef Documentation

◆ Clkmgr_ClockSyncData

Opaque alias for clock synchronization data

Function Documentation

◆ clkmgr_constructClockSyncDataInstance()

Clkmgr_ClockSyncData * clkmgr_constructClockSyncDataInstance ( void  )

Construct a clock sync data object

Returns
Pointer to a new Clkmgr_ClockSyncData object

◆ clkmgr_destroyClockSyncDataInstance()

void clkmgr_destroyClockSyncDataInstance ( Clkmgr_ClockSyncData data_c)

Destroy a ClockSyncData_C object

Parameters
[in]data_cPointer to the Clkmgr_ClockSyncData object to destroy

◆ clkmgr_getClockOffset()

int64_t clkmgr_getClockOffset ( const Clkmgr_ClockSyncData data_c,
enum Clkmgr_ClockType  clock_type 
)

Get the clock offset in nanosecond

Parameters
[in]data_cPointer of the Clkmgr_ClockSyncData
[in]clock_typeThe type of clock to set
Returns
Clock offset in nanosecond
Note
The clock type is a bit that represents a type of clock, as defined by enum Clkmgr_ClockType

◆ clkmgr_getGmChangedEventCount()

uint32_t clkmgr_getGmChangedEventCount ( const Clkmgr_ClockSyncData data_c,
enum Clkmgr_ClockType  clock_type 
)

Get the count of grandmaster changed event

Parameters
[in]data_cPointer of the Clkmgr_ClockSyncData
[in]clock_typeThe type of clock to set
Returns
The count of grandmaster changed event
Note
This count indicates how many times the grandmaster has changed since the last call to statusWait() or statusWaitByName()
The clock type is a bit that represents a type of clock, as defined by enum Clkmgr_ClockType

◆ clkmgr_getGmIdentity()

uint64_t clkmgr_getGmIdentity ( const Clkmgr_ClockSyncData data_c,
enum Clkmgr_ClockType  clock_type 
)

Get the grandmaster clock identity

Parameters
[in]data_cPointer of the Clkmgr_ClockSyncData
[in]clock_typeThe type of clock to set
Returns
Grandmaster clock identity
Note
The grandmaster is the source clock for the PTP domain (network), whom all the clocks will synchronize to.
The clock type is a bit that represents a type of clock, as defined by enum Clkmgr_ClockType

◆ clkmgr_getNotificationTimestamp()

uint64_t clkmgr_getNotificationTimestamp ( const Clkmgr_ClockSyncData data_c,
enum Clkmgr_ClockType  clock_type 
)

Get the notification timestamp in nanosecond

Parameters
[in]data_cPointer of the Clkmgr_ClockSyncData
[in]clock_typeThe type of clock to set
Returns
Notification timestamp in nanosecond
Note
This timestamp indicates to the most recent time in CLOCK_REALTIME when the Client received a clock sync data notification from the Proxy
The clock type is a bit that represents a type of clock, as defined by enum Clkmgr_ClockType

◆ clkmgr_getOffsetInRangeEventCount()

uint32_t clkmgr_getOffsetInRangeEventCount ( const Clkmgr_ClockSyncData data_c,
enum Clkmgr_ClockType  clock_type 
)

Get the count of clock offset in-range event

Parameters
[in]data_cPointer of the Clkmgr_ClockSyncData
[in]clock_typeThe type of clock to set
Returns
The count of clock offset in-range event
Note
This count indicates the number of times the clock offset has transitioned from in-range to out-of-range or vice versa since the last call to statusWait() or statusWaitByName()
The clock type is a bit that represents a type of clock, as defined by enum Clkmgr_ClockType

◆ clkmgr_getPtpAsCapableEventCount()

uint32_t clkmgr_getPtpAsCapableEventCount ( const Clkmgr_ClockSyncData data_c)

Get the count of IEEE 802.1AS capable event

Parameters
[in]data_cPointer of the Clkmgr_ClockSyncData
Returns
The count of IEEE 802.1AS capable event
Note
This count indicates the number of times the clock has transitioned from non capable to capable or vice versa since the last call to statusWait() or statusWaitByName()

◆ clkmgr_getPtpCompositeEventCount()

uint32_t clkmgr_getPtpCompositeEventCount ( const Clkmgr_ClockSyncData data_c)

Get the count of composite event

Parameters
[in]data_cPointer of the Clkmgr_ClockSyncData
Returns
The count of composite event
Note
This count indicates the number of times the condition of composite event has transitioned from not met to met or vice versa since the last call to statusWait() or statusWaitByName()

◆ clkmgr_getPtpSyncedWithGmEventCount()

uint32_t clkmgr_getPtpSyncedWithGmEventCount ( const Clkmgr_ClockSyncData data_c)

Get the count of clock synced with grandmaster event

Parameters
[in]data_cPointer of the Clkmgr_ClockSyncData
Returns
The count of clock synced with grandmaster event
Note
This count indicates the number of times the clock has transitioned from synced with grandmaster to out-of-sync or vice versa since the last call to statusWait() or statusWaitByName()

◆ clkmgr_getSyncInterval()

uint64_t clkmgr_getSyncInterval ( const Clkmgr_ClockSyncData data_c,
enum Clkmgr_ClockType  clock_type 
)

Get the synchronization interval in microsecond

Parameters
[in]data_cPointer of the Clkmgr_ClockSyncData
[in]clock_typeThe type of clock to set
Returns
Synchronization interval in microsecond
Note
This interval indicates the time between clock update messages send to the local service that synchronizing clock. This interval specify the time the synchronization protocol may need to react for a change in the grandmaster.
The clock type is a bit that represents a type of clock, as defined by enum Clkmgr_ClockType

◆ clkmgr_havePtpData()

bool clkmgr_havePtpData ( const Clkmgr_ClockSyncData data_c)

Check if the PTP clock is available

Parameters
[in]data_cPointer of the Clkmgr_ClockSyncData
Returns
True if the PTP clock is available, false otherwise

◆ clkmgr_haveSysData()

bool clkmgr_haveSysData ( const Clkmgr_ClockSyncData data_c)

Check if the system clock is available

Parameters
[in]data_cPointer of the Clkmgr_ClockSyncData
Returns
True if the system clock is available, false otherwise

◆ clkmgr_isGmChanged()

bool clkmgr_isGmChanged ( const Clkmgr_ClockSyncData data_c,
enum Clkmgr_ClockType  clock_type 
)

Check if the grandmaster has changed

Parameters
[in]data_cPointer of the Clkmgr_ClockSyncData
[in]clock_typeThe type of clock to set
Returns
True if the grandmaster has changed, false otherwise
Note
This boolean variable indicates if the grandmaster has changed since the last call of statusWait() or statusWaitByName()
The clock type is a bit that represents a type of clock, as defined by enum Clkmgr_ClockType

◆ clkmgr_isOffsetInRange()

bool clkmgr_isOffsetInRange ( const Clkmgr_ClockSyncData data_c,
enum Clkmgr_ClockType  clock_type 
)

Check if the clock offset is in-range

Parameters
[in]data_cPointer of the Clkmgr_ClockSyncData
[in]clock_typeThe type of clock to set
Returns
True if the clock offset is in-range, false otherwise
Note
The range of clock offset is defined by user during subscription
The clock type is a bit that represents a type of clock, as defined by enum Clkmgr_ClockType

◆ clkmgr_isPtpAsCapable()

bool clkmgr_isPtpAsCapable ( const Clkmgr_ClockSyncData data_c)

Check if the clock is an IEEE 802.1AS capable

Parameters
[in]data_cPointer of the Clkmgr_ClockSyncData
Returns
True if the clock is an IEEE 802.1AS capable, false otherwise

◆ clkmgr_isPtpCompositeEventMet()

bool clkmgr_isPtpCompositeEventMet ( const Clkmgr_ClockSyncData data_c)

Check if all the conditions in the subscribed composite event are met

Parameters
[in]data_cPointer of the Clkmgr_ClockSyncData
Returns
True if all the conditions are met, false otherwise
Note
Condition of composite event is defined by the user during subsciption

◆ clkmgr_isPtpSyncedWithGm()

bool clkmgr_isPtpSyncedWithGm ( const Clkmgr_ClockSyncData data_c)

Check if the PTP clock is synchronized with a grandmaster

Parameters
[in]data_cPointer of the Clkmgr_ClockSyncData
Returns
True if the clock is synchronized with a grandmaster, false if otherwise