Check PTP_SYS_OFFSET_PRECISE ioctl
Check that PTP_SYS_OFFSET_PRECISE
ioctl can be used to obtain PTP device time and system time at the same moment.
Find out PTP device associated with the IUT interface, call open() to get its FD.
Call ioctl (
PTP_SYS_OFFSET_PRECISE
) on the PTP device FD to get timestamps for PTP device,CLOCK_REALTIME
andCLOCK_MONOTONIC_RAW
at the same moment.Estimate difference between PTP clock and
CLOCK_REALTIME
as device - sys_realtime in obtained response. Check that two consecutive clock_gettime() calls on PTP device andCLOCK_REALTIME
show similar difference between timestamps.Estimate difference between PTP clock and
CLOCK_MONOTONIC_RAW
as device - sys_monoraw in obtained response. Check that two consecutive clock_gettime() calls on PTP device andCLOCK_MONOTONIC_RAW
show similar difference between timestamps.
Parameters:
env |
Testing environment: |