clkmgr 2.0
Clock Manager API library to receive events from the PTP service
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
ClockManager Class Reference

#include <clockmanager.h>

Static Public Member Functions

static ClockManagerfetchSingleInstance ()
 
static bool connect ()
 
static bool disconnect ()
 
static const TimeBaseConfigurationsgetTimebaseCfgs ()
 
static bool subscribeByName (const ClockSyncSubscription &newSub, const std::string &timeBaseName, ClockSyncData &clockSyncData)
 
static bool subscribe (const ClockSyncSubscription &newSub, size_t timeBaseIndex, ClockSyncData &clockSyncData)
 
static enum StatusWaitResult statusWaitByName (int timeout, const std::string &timeBaseName, ClockSyncData &clockSyncData)
 
static enum StatusWaitResult statusWait (int timeout, size_t timeBaseIndex, ClockSyncData &clockSyncData)
 
static bool getTime (timespec &ts)
 

Detailed Description

Provide APIs to set up Client and monitor clock synchronization events.

Note
This is a singleton class

Member Function Documentation

◆ connect()

static bool ClockManager::connect ( )
static

Establish connection between Client and Proxy

Returns
True on success, false on failure

◆ disconnect()

static bool ClockManager::disconnect ( )
static

Remove the connection between Client and Proxy

Returns
True on success, false on failure

◆ fetchSingleInstance()

static ClockManager & ClockManager::fetchSingleInstance ( )
static

Fetch the single instance of object

Returns
Reference to the single instance

◆ getTime()

static bool ClockManager::getTime ( timespec &  ts)
static

Retrieve the time of the CLOCK_REALTIME

Parameters
[out]tstimestamp of the CLOCK_REALTIME
Returns
True on success, false on failure

◆ getTimebaseCfgs()

static const TimeBaseConfigurations & ClockManager::getTimebaseCfgs ( )
static

Get the configurations of available time-bases

Returns
Reference to the TimeBaseConfigurations object

◆ statusWait()

static enum StatusWaitResult ClockManager::statusWait ( int  timeout,
size_t  timeBaseIndex,
ClockSyncData clockSyncData 
)
static

Wait for status changes in the specified time-base by providing the timeBaseIndex and a timeout duration

Parameters
[in]timeoutTimeout duration in seconds
  • -1: wait indefinitely until at least an event change occurs
  • 0: retrieve the latest clock sync data immediately
[in]timeBaseIndexIndex of the time-base to be monitored
[out]clockSyncDataReference to the current telemetry data and synchronization errors
Returns
Status of wait
  • SWRLostConnection: Lost connection to Proxy
  • SWRInvalidArgument: Invalid argument
  • SWRNoEventDetected: No event changes detected
  • SWREventDetected: At least an event change detected
Note
Calling this API will reset all event counts

◆ statusWaitByName()

static enum StatusWaitResult ClockManager::statusWaitByName ( int  timeout,
const std::string &  timeBaseName,
ClockSyncData clockSyncData 
)
static

Wait for status changes in the specified time-base by providing the timeBaseName and a timeout duration

Parameters
[in]timeoutTimeout duration in seconds
  • -1: wait indefinitely until at least an event change occurs
  • 0: retrieve the latest clock sync data immediately
[in]timeBaseNameName of the time-base to be monitored
[out]clockSyncDataReference to the current telemetry data and synchronization errors
Returns
Status of wait
  • SWRLostConnection: Lost connection to Proxy
  • SWRInvalidArgument: Invalid argument
  • SWRNoEventDetected: No event changes detected
  • SWREventDetected: At least an event change detected
Note
Calling this API will reset all event counts

◆ subscribe()

static bool ClockManager::subscribe ( const ClockSyncSubscription newSub,
size_t  timeBaseIndex,
ClockSyncData clockSyncData 
)
static

Subscribe to specific time-base by providing timeBaseIndex and interested events.

Parameters
[in]newSubReference to the subscription details
[in]timeBaseIndexIndex of the time-base to be subscribed
[out]clockSyncDataReference to the current telemetry data and synchronization errors
Returns
True on successful subscription, false on failure
Note
Event counting will begin once this API is called

◆ subscribeByName()

static bool ClockManager::subscribeByName ( const ClockSyncSubscription newSub,
const std::string &  timeBaseName,
ClockSyncData clockSyncData 
)
static

Subscribe to specific time-base by providing timeBaseName and interested events.

Parameters
[in]newSubReference to the subscription details
[in]timeBaseNameName of the time-base to be subscribed
[out]clockSyncDataReference to the current telemetry data and synchronization errors
Returns
True on successful subscription, false on failure
Note
Event counting will begin once this API is called

The documentation for this class was generated from the following file: