gPTP Documentation
|
#include <linux_hal_generic.hpp>
Public Member Functions | |
LinuxTimestamperGeneric () | |
bool | resetFrequencyAdjustment () |
Resets frequency adjustment value to zero and calls linux system calls for frequency adjustment. More... | |
bool | Adjust (void *tmx) |
Calls linux system call for adjusting frequency or phase. More... | |
virtual bool | HWTimestamper_init (InterfaceLabel *iface_label, OSNetworkInterface *iface) |
Initializes the Hardware timestamp interface. More... | |
void | pushRXTimestamp (Timestamp *tstamp) |
Inserts a new timestamp to the beginning of the RX timestamp list. More... | |
bool | post_init (int ifindex, int sd, TicketingLock *lock) |
Post initialization procedure. More... | |
virtual bool | HWTimestamper_gettime (Timestamp *system_time, Timestamp *device_time, uint32_t *local_clock, uint32_t *nominal_clock_rate) |
Gets the ptp clock time information. More... | |
virtual int | HWTimestamper_txtimestamp (PortIdentity *identity, uint16_t sequenceId, Timestamp ×tamp, unsigned &clock_value, bool last) |
Gets the TX timestamp from hardware interface. More... | |
virtual int | HWTimestamper_rxtimestamp (PortIdentity *identity, uint16_t sequenceId, Timestamp ×tamp, unsigned &clock_value, bool last) |
Gets the RX timestamp from the hardware interface. This Currently the RX timestamp is retrieved at LinuxNetworkInterface::nrecv method. More... | |
virtual bool | HWTimestamper_adjclockphase (int64_t phase_adjust) |
Adjusts the clock phase. More... | |
virtual bool | HWTimestamper_adjclockrate (float freq_offset) |
Adjusts the frequency. More... | |
virtual | ~LinuxTimestamperGeneric () |
Public Member Functions inherited from LinuxTimestamper | |
virtual | ~LinuxTimestamper ()=0 |
Public Member Functions inherited from HWTimestamper | |
virtual void | HWTimestamper_final (void) |
This method is called before the object is de-allocated. 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 () | |
Additional Inherited Members | |
Protected Attributes inherited from HWTimestamper | |
uint8_t | version |
HWTimestamper version. | |
Linux timestamper generic interface
LinuxTimestamperGeneric::LinuxTimestamperGeneric | ( | ) |
Default constructor. Initializes internal variables
|
virtual |
deletes LinuxTimestamperGeneric object
bool LinuxTimestamperGeneric::Adjust | ( | void * | tmx | ) |
Calls linux system call for adjusting frequency or phase.
tmx | [in] Void pointer that must be cast (and filled in correctly) to the struct timex |
|
virtual |
Adjusts the clock phase.
phase_adjust | Phase adjustment |
Reimplemented from HWTimestamper.
|
virtual |
Adjusts the frequency.
freq_offset | Frequency adjustment |
Reimplemented from HWTimestamper.
|
virtual |
Gets the ptp clock time information.
system_time | [out] System time |
device_time | [out] Device time |
local_clock | Not Used |
nominal_clock_rate | Not Used |
Implements HWTimestamper.
|
virtual |
Initializes the Hardware timestamp interface.
iface_label | [in] Network interface label (used to find the phc index) |
iface | [in] Network interface |
Reimplemented from HWTimestamper.
|
inlinevirtual |
Gets the RX timestamp from the hardware interface. This Currently the RX timestamp is retrieved at LinuxNetworkInterface::nrecv method.
identity | PTP port identity |
sequenceId | Sequence ID |
timestamp | [out] Timestamp value |
clock_value | [out] Clock value |
last | Signalizes that it is the last timestamp to get. When TRUE, releases the lock when its done. |
Implements HWTimestamper.
|
virtual |
Gets the TX timestamp from hardware interface.
identity | PTP port identity |
sequenceId | Sequence ID |
timestamp | [out] Timestamp value |
clock_value | [out] Clock value |
last | Signalizes that it is the last timestamp to get. When TRUE, releases the lock when its done. |
Implements HWTimestamper.
|
virtual |
Post initialization procedure.
ifindex | struct ifreq.ifr_ifindex value |
sd | Socket file descriptor |
lock | [in] Instance of TicketingLock object |
Implements LinuxTimestamper.
|
inline |
Inserts a new timestamp to the beginning of the RX timestamp list.
tstamp | [in] RX timestamp |
bool LinuxTimestamperGeneric::resetFrequencyAdjustment | ( | ) |
Resets frequency adjustment value to zero and calls linux system calls for frequency adjustment.