On Wed, Mar 07, 2018 at 09:00:16AM +0100, Oliver Westermann wrote:
> My issue is a bit different from the script solution (and I'm not 100% sure
> the script is robust to my issue):

Give it a try...

> If I always take the first correct response - Identity pair, I will soon
> only read outdated data.

So... don't wait for five seconds, just print every matching pair.  In
the main program (the parent of the fork) just poll on the input FD.
That way, you always have the most up to date values.  If the values
update more often than every 5 seconds because of other requests, all
the better!  Also, then you won't need to send a request every 5
seconds.  Instead, set a 5 second watchdog timer that triggers the
request on timeout.

It really isn't all that hard, but as I said before, the pmc is really
a simple tool.  The only truly robust way is to send UDS packets from
your application directly, just as phc2sys does.  If you don't mind
linking to a GPL (not LPGL) program, you can even use the helper
functions in pmc_common.c

HTH,
Richard

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users

Reply via email to