On Mon, Nov 01, 2021 at 03:56:38AM -0700, Richard Cochran wrote:
> On Mon, Nov 01, 2021 at 11:19:15AM +0200, Vladimir Oltean wrote:
> 
> > For what it's worth, I have solved both my problems (checking ptp4l sync
> > and phc2sys sync) through alternative methods,
> 
> How did you do it?

For checking ptp4l sync I wrote my own PTP management message handling
over the local AF_UNIX socket and I am querying the CURRENT_DATA_SET.
For checking phc2sys sync I shamelessly stole the relevant logic from
phc2sys (read_phc/sysoff_measure), including the various PTP_SYS_OFFSET_*
ioctls, and I am just calculating the PHC's offset to CLOCK_REALTIME.

So both of these are local. Then I created some communication protocol
in my application (sender and receiver roles) so that the sender queries
the receiver about its local sync data, and then has the logic necessary
to figure out whether now is a good time to send or not.


_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to