Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

How do you use Rx Timestamp?

Avatar
Rank

Total Posts: 21

Joined 2011-11-08

PM

How do you use Rx Timestamp? I'm using a Wahoo dongle on the iPhone to receive somewhat time sensitive data. Currently I'm time stamping messages using the iOS system clock. Since data is received on the main thread, if the app pauses for a moment, then the messages get buffered and all get timestamped when the app becomes responsive again.

I can use the Rx Timestamp to ensure the time delta between messages is correct, but is there a way to use the Rx Timestamp to get absolute time? Is there any way to get/set the current value of the counter from the ANT module.

Or, should i uses the iOS system clock value and the Rx Timestamp value. If the deltas match, assume the iOS Timestamp Value is correct. And if they don't match, use the Rx Timestamp value to correct the value from the iOS system clock based on the message with the last known good value?      
RankRankRankRank

Total Posts: 156

Joined 2013-01-07

PM

The time stamp can be used to keep track of system time if your app is aware of the time at which ANT communication was started. The time stamp is a 2 byte field based on a 32kHz clock (rolls over every 2 seconds), so your app would need to receive an ANT message at least once every 2 seconds to keep track of time.

The time stamp cannot be set, and setting it would not be useful as you are dealing with intervals of 1/32768 s to a maximum of 2s. If time stamp messages are enabled then you will get a time stamp value with each ANT message you receive.

The last solution you propose seems to be the most sound if you are receiving ANT messages on a regular interval (< 2 seconds).

For more information about enabling and using ANT timestamps refer to section 7.1 of the ANT Message Protocol and Usage document.