.. index:: pair: group; Check PTP_SYS_OFFSET_EXTENDED ioctl .. _doxid-group__ptp-sys__offset__extended: Check PTP_SYS_OFFSET_EXTENDED ioctl =================================== .. toctree:: :hidden: Check that ``PTP_SYS_OFFSET_EXTENDED`` ioctl can be used to obtain samples of 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_EXTENDED``) on the PTP device FD asking for **n_samples** samples. #. Compute average difference between timestamps from PTP and system clocks over the array of retrieved samples. Check that difference in every sample is close to that average. #. Estimate offset between PTP and system clocks with help of two consecutive **clock_gettime()** calls. Check that this estimate is close to the average difference between clocks obtained with ``PTP_SYS_OFFSET_EXTENDED``. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - env - Testing environment: * :ref:`env.peer2peer ` * - n_samples - How many samples to request from PTP_SYS_OFFSET_EXTENDED