gPTP Documentation
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
HWTimestamper Class Referenceabstract

#include <ieee1588.hpp>

Inheritance diagram for HWTimestamper:
Inheritance graph
Collaboration diagram for HWTimestamper:
Collaboration graph

Public Member Functions

virtual bool HWTimestamper_init (InterfaceLabel *iface_label, OSNetworkInterface *iface)
 Initializes the hardware timestamp unit. More...
 
virtual void HWTimestamper_final (void)
 This method is called before the object is de-allocated. More...
 
virtual bool HWTimestamper_adjclockrate (float frequency_offset)
 Adjusts the hardware clock frequency. More...
 
virtual bool HWTimestamper_adjclockphase (int64_t phase_adjust)
 Adjusts the hardware clock phase. More...
 
virtual bool HWTimestamper_gettime (Timestamp *system_time, Timestamp *device_time, uint32_t *local_clock, uint32_t *nominal_clock_rate)=0
 Get the cross timestamping information. The gPTP subsystem uses these samples to calculate ratios which can be used to translate or extrapolate one clock into another clock reference. The gPTP service uses these supplied cross timestamps to perform internal rate estimation and conversion functions. More...
 
virtual int HWTimestamper_txtimestamp (PortIdentity *identity, uint16_t sequenceId, Timestamp &timestamp, unsigned &clock_value, bool last)=0
 Gets the tx timestamp from hardware. More...
 
virtual int HWTimestamper_rxtimestamp (PortIdentity *identity, uint16_t sequenceId, Timestamp &timestamp, unsigned &clock_value, bool last)=0
 Get rx timestamp. More...
 
virtual bool HWTimestamper_get_extclk_offset (Timestamp *local_time, int64_t *clk_offset, int32_t *ppt_freq_offset)
 Get external clock offset. More...
 
virtual void HWTimestamper_get_extderror (char *msg)
 Gets a string with the error from the hardware timestamp block. More...
 
virtual bool HWTimestamper_PPS_start ()
 Starts the PPS (pulse per second) interface. More...
 
virtual bool HWTimestamper_PPS_stop ()
 Stops the PPS (pulse per second) interface. More...
 
int getVersion ()
 Gets the HWTimestamper version. More...
 
 HWTimestamper ()
 

Protected Attributes

uint8_t version
 HWTimestamper version.
 

Detailed Description

Provides a generic interface for hardware timestamping

Constructor & Destructor Documentation

HWTimestamper::HWTimestamper ( )
inline

Default constructor. Sets version to zero.

Member Function Documentation

int HWTimestamper::getVersion ( )
inline

Gets the HWTimestamper version.

Returns
version (signed integer)
virtual bool HWTimestamper::HWTimestamper_adjclockphase ( int64_t  phase_adjust)
inlinevirtual

Adjusts the hardware clock phase.

Parameters
phase_adjustPhase offset
Returns
false

Reimplemented in LinuxTimestamperGeneric.

virtual bool HWTimestamper::HWTimestamper_adjclockrate ( float  frequency_offset)
inlinevirtual

Adjusts the hardware clock frequency.

Parameters
frequency_offsetFrequency offset
Returns
false

Reimplemented in LinuxTimestamperGeneric.

virtual void HWTimestamper::HWTimestamper_final ( void  )
inlinevirtual

This method is called before the object is de-allocated.

Returns
void
virtual bool HWTimestamper::HWTimestamper_get_extclk_offset ( Timestamp local_time,
int64_t *  clk_offset,
int32_t *  ppt_freq_offset 
)
inlinevirtual

Get external clock offset.

Parameters
local_time[inout] Local time
clk_offset[inout] clock offset
ppt_freq_offset[inout] Frequency offset in ppts
Returns
false
Todo:
This code should be removed. It was a hack to get a specific board working.
virtual void HWTimestamper::HWTimestamper_get_extderror ( char *  msg)
inlinevirtual

Gets a string with the error from the hardware timestamp block.

Parameters
msg[out] String error
Returns
void
Todo:
There is no current implementation for this method.
virtual bool HWTimestamper::HWTimestamper_gettime ( Timestamp system_time,
Timestamp device_time,
uint32_t *  local_clock,
uint32_t *  nominal_clock_rate 
)
pure virtual

Get the cross timestamping information. The gPTP subsystem uses these samples to calculate ratios which can be used to translate or extrapolate one clock into another clock reference. The gPTP service uses these supplied cross timestamps to perform internal rate estimation and conversion functions.

Parameters
system_time[out] System time
device_time[out] Device time
local_clock[out] Local clock
nominal_clock_rate[out] Nominal clock rate
Returns
True in case of success. FALSE in case of error

Implemented in WindowsTimestamper, LinuxTimestamperGeneric, and LinuxTimestamperIntelCE.

virtual bool HWTimestamper::HWTimestamper_init ( InterfaceLabel iface_label,
OSNetworkInterface iface 
)
inlinevirtual

Initializes the hardware timestamp unit.

Parameters
iface_label[in] Interface label
iface[in] Network interface
Returns
true

Reimplemented in WindowsTimestamper, LinuxTimestamperGeneric, and LinuxTimestamperIntelCE.

virtual bool HWTimestamper::HWTimestamper_PPS_start ( )
inlinevirtual

Starts the PPS (pulse per second) interface.

Returns
false
virtual bool HWTimestamper::HWTimestamper_PPS_stop ( )
inlinevirtual

Stops the PPS (pulse per second) interface.

Returns
true
virtual int HWTimestamper::HWTimestamper_rxtimestamp ( PortIdentity identity,
uint16_t  sequenceId,
Timestamp timestamp,
unsigned &  clock_value,
bool  last 
)
pure virtual

Get rx timestamp.

Parameters
identityPTP port identity
sequenceIdSequence ID
timestamp[out] Timestamp value
clock_value[out] Clock value
lastSignalizes that it is the last timestamp to get. When TRUE, releases the lock when its done.
Returns
0 no error, -1 error, -72 try again.

Implemented in WindowsTimestamper, LinuxTimestamperGeneric, and LinuxTimestamperIntelCE.

virtual int HWTimestamper::HWTimestamper_txtimestamp ( PortIdentity identity,
uint16_t  sequenceId,
Timestamp timestamp,
unsigned &  clock_value,
bool  last 
)
pure virtual

Gets the tx timestamp from hardware.

Parameters
identityPTP port identity
sequenceIdSequence ID
timestamp[out] Timestamp value
clock_value[out] Clock value
lastSignalizes that it is the last timestamp to get. When TRUE, releases the lock when its done.
Returns
0 no error, -1 error, -72 try again.

Implemented in WindowsTimestamper, LinuxTimestamperGeneric, and LinuxTimestamperIntelCE.


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