Page 1 of 1
Timestamp with Android API
Posted: Tue 25. Jul 2017, 09:31
by Thibault
Hello,
I am using the Android API with your CAN to wifi HW. It all works fine. We still have a question on the timestamp. How to use the info timestamp lo and timestamp hi to build the timing of reception of the frame (which should be only one timestamp).
Thanks for your support
Best regards
Re: Timestamp with Android API
Posted: Wed 26. Jul 2017, 10:37
by PEAK-Support
** we moved this thread to the correct position - WLAN Gateway **
Here a sample (using WireShark with our free Dissector)
You see two time stamps:

- timestamp.JPG (43.7 KiB) Viewed 6424 times
The Result is 1485329780 and here how to calculate ((ts_h << 32 + ts_l) / 1000000) in Seconds.
This means: Wed, 25 Jan 2017 07:36:20 - see
http://www.unixtimestamp.com/index.php
The time is based on the internal RTC. If the RTC Battery is empty - the value is 0 --> 1970-01-01 00:00:00 UTC
Re: Timestamp with Android API
Posted: Fri 28. Jul 2017, 05:09
by Bruno
Thank you for answering quickly but there's still something odd:
In a message int timestamp_lo = -1138924563 (0xBC1D63ED) and int timestamp_hi = 349517 (0x0005554D) so long timestamp64 = 1501162945 seconds whereas the system timestamp is 1501168955 (System.currentTimeMillis() / 1000L).
Re: Timestamp with Android API
Posted: Fri 28. Jul 2017, 12:56
by PEAK-Support
sorry?!? we did not understand your question - please explain where you get both timestamps from ...