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.

  1. Find out PTP device associated with the IUT interface, call open() to get its FD.

  2. Call ioctl (PTP_SYS_OFFSET_PRECISE) on the PTP device FD to get timestamps for PTP device, CLOCK_REALTIME and CLOCK_MONOTONIC_RAW at the same moment.

  3. 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 and CLOCK_REALTIME show similar difference between timestamps.

  4. 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 and CLOCK_MONOTONIC_RAW show similar difference between timestamps.

Parameters:

env

Testing environment: