-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can unicast and hardware timestamp be used? #5
Comments
Hi, |
I've had a bit of a play with tx timestamping and have a working example. Just need to fit it in to the structure of the ptpmonkey code. |
Hi martim01 |
Hi, In terms of the RX timestamps. In Receiver::DoReceive has the function ioctl(socket, SIOCGSTAMPNS...) - this should get the hardware/software timestamp for the received message. Unicast should be possible, though not yet implemented. The Run() functions of the Sender and Receiver would need to be changed to reflect the destination address. Also the operation of Unicast PTP includes "Announce Request" and "Announce Grant" messages which I have not implemented. |
Hi martim01 I didn't know this information before, where did you see it? I did not search this information at https://github.com/wowczarek/ptpd, I thought SIOCGSTAMPNS can only get the SO_TIMESTAMPNS software timestamp? And how do I know if the hardware time stamp or the software time stamp is obtained? Are there any plans for unicast implementation? |
from wowczarek ptpd source , In terms of the RX hardware timestamps , It should be the same as the TX hardware timestamp, and the SO_TIMESTAMPING value is also obtained through the recvmsg function, but do not set the MSG_ERRQUEUE flag. SIOCGSTAMPNS - more accurate socket time stamp, is still a socket time ,then must be a software timestamp. thanks! |
Yes - I think you are correct about the Rx ioctl call. There were a couple of stackoverflow posts that implied that this call returned a hardware Rx timestamp if it was available but I think they might be mistaken. This is a shame as I'm not sure if using Asio and getting the ancillary data will be possible. In terms of unicast. I would like to implement it - I need to find some more information on the message structures that are used for unicast PTP though as there doesn't seem to be a huge amount of "free" documentation about them out there. |
Ok - so it looks like I can use an async_wait call in Asio and then get the native socket handle to do the recvmsg function to get the anicllary data. It feels a bit messy but should work to get the rx hardware timestamp if it is available... |
Hi martim01 |
Hi, |
Hi
Recently, I am looking for a simple ptp protocol implementation. Your project is of great reference significance.
If my device supports hardware time stamping(tx and rx), can use it ?
thanks!
The text was updated successfully, but these errors were encountered: