|Subject:||Re: [lwip-users] lwIP 1.4.0 with SNTP Client|
|Date:||Sun, 13 Nov 2011 13:23:47 +0800|
As I known the sntp has already been done on lwip. An application note and sample code/project can be accesaed on the st.com(st semiconductor)
I’ve recently started using lwIP with the STR912 processor. This is my first experience with lwIP and I’ve managed to port this for my processor relatively easily with the Sockets API. I’m wanting to use the SNTP client app, but modify it slightly to use the time the packet was received by Ethernet driver to calculate the time offset. The current SNTP client just uses the transmit time in the SNTP message from the server to update the system time.
I’m thinking the best way would be to take a timestamp of the time when each ethernet packet is received and somehow pass this along with the packet to the SNTP application.
As I’ve not used lwIP before I’m struggling to find a way to pass this timestamp to the SNTP routine and keep it reference to the SNTP packet. I have considered storing this in the pbuf but I’m not keen on modifying the pbuf without a better understanding the implications of this. I have also looked at adding this time to the end of the Rx buffer, then storing this in the pbuf but as this is passed through the ip_input routine the additional data is stripped from the buffer as its not part of the original packet.
Does anyone have any experience of implementing anything similar, or any ideas or tips of achieving this.
Registered in England No. 6250603, VAT Reg. No. GB 171671070,
RTK Instruments Ltd, St James Business Park, Knaresborough, HG5 8PJ
A member of the MTL Instruments Group
lwip-users mailing list
|[Prev in Thread]||Current Thread||[Next in Thread]|