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

C wrapper to the Clock Manager APIs to set up Client and monitor clock synchronization events. More...

#include "pub/clkmgr/types_c.h"
#include "pub/clkmgr/timebase_configs_c.h"
#include "pub/clkmgr/subscription_c.h"
#include "pub/clkmgr/event_c.h"
#include <time.h>
Include dependency graph for clockmanager_c.h:

Go to the source code of this file.

Functions

bool clkmgr_connect ()
 
bool clkmgr_disconnect ()
 
size_t clkmgr_getTimebaseCfgsSize ()
 
bool clkmgr_subscribeByName (const Clkmgr_Subscription *sub_c, const char *timeBaseName, Clkmgr_ClockSyncData *data_c)
 
bool clkmgr_subscribe (const Clkmgr_Subscription *sub_c, size_t timeBaseIndex, Clkmgr_ClockSyncData *data_c)
 
enum Clkmgr_StatusWaitResult clkmgr_statusWaitByName (int timeout, const char *timeBaseName, Clkmgr_ClockSyncData *data_c)
 
enum Clkmgr_StatusWaitResult clkmgr_statusWait (int timeout, size_t timeBaseIndex, Clkmgr_ClockSyncData *data_c)
 
bool clkmgr_getTime (struct timespec *ts)
 

Detailed Description

C wrapper to the Clock Manager APIs to set up Client and monitor clock synchronization events.

Author
Song Yoong Siang <yoong.siang.song@intel.com>

Function Documentation

◆ clkmgr_connect()

bool clkmgr_connect ( )

Connect the client

Returns
true on success, false on failure

◆ clkmgr_disconnect()

bool clkmgr_disconnect ( )

Disconnect the client

Returns
true on success, false on failure

◆ clkmgr_getTime()

bool clkmgr_getTime ( struct timespec *  ts)

Retrieve the time of the CLOCK_REALTIME

Parameters
[out]tstimestamp of the CLOCK_REALTIME
Returns
true on success

◆ clkmgr_getTimebaseCfgsSize()

size_t clkmgr_getTimebaseCfgsSize ( )

Get the size of the time base configurations

Returns
The size of the time base configurations

◆ clkmgr_statusWait()

enum Clkmgr_StatusWaitResult clkmgr_statusWait ( int  timeout,
size_t  timeBaseIndex,
Clkmgr_ClockSyncData data_c 
)

Waits for a specified timeout period for any event changes

Parameters
[in]timeoutTThe timeout in seconds. If timeout is 0, the function will check event changes once. If timeout is -1, the function will wait until there is event changes occurs
[in]timeBaseIndexIndex of the time base to be monitored
[out]data_cPointer to the Clkmgr_ClockSyncData
Returns
Status of wait
  • Clkmgr_SWRLostConnection: Lost connection to Proxy
  • Clkmgr_SWRInvalidArgument: Invalid argument
  • Clkmgr_SWRNoEventDetected: No event changes detected
  • Clkmgr_SWREventDetected: At least an event change detected

◆ clkmgr_statusWaitByName()

enum Clkmgr_StatusWaitResult clkmgr_statusWaitByName ( int  timeout,
const char *  timeBaseName,
Clkmgr_ClockSyncData data_c 
)

Waits for a specified timeout period for any event changes by name of the time base

Parameters
[in]timeoutThe timeout in seconds. If timeout is 0, the function will check event changes once. If timeout is -1, the function will wait until there is event changes occurs
[in]timeBaseNameName of the time base to be monitored
[out]data_cPointer to the Clkmgr_ClockSyncData
Returns
Status of wait
  • Clkmgr_SWRLostConnection: Lost connection to Proxy
  • Clkmgr_SWRInvalidArgument: Invalid argument
  • Clkmgr_SWRNoEventDetected: No event changes detected
  • Clkmgr_SWREventDetected: At least an event change detected

◆ clkmgr_subscribe()

bool clkmgr_subscribe ( const Clkmgr_Subscription sub_c,
size_t  timeBaseIndex,
Clkmgr_ClockSyncData data_c 
)

Subscribe to client events

Parameters
[in]sub_cPointer to the Clkmgr_Subscription
[in]timeBaseIndexIndex of the time base to be subscribed
[out]data_cPointer to the Clkmgr_ClockSyncData
Returns
true on success, false on failure

◆ clkmgr_subscribeByName()

bool clkmgr_subscribeByName ( const Clkmgr_Subscription sub_c,
const char *  timeBaseName,
Clkmgr_ClockSyncData data_c 
)

Subscribe to client events by name for the time base

Parameters
[in]sub_cPointer to the Clkmgr_Subscription
[in]timeBaseNameName of the time base to be subscribed
[out]data_cPointer to the Clkmgr_ClockSyncData
Returns
true on success, false on failure