MWM-for-Android icon indicating copy to clipboard operation
MWM-for-Android copied to clipboard

Latency with sendRtcNow()

Open benjymous opened this issue 12 years ago • 1 comments

The Watch's time can often be a few seconds behind the time on the phone - this is caused by the messaging queue that MWM uses - the time is set when the watch gets connected, when there's lots of other stuff going on, so there'll be a delay between the function getting called, and the message actually getting sent to the watch.

Possible solutions would be to fill in the actual time when the message really gets sent, or to force the message straight to the head of the queue. We could also do clever stuff by querying the watch time, then sending adjustments until the time matches.

( see http://www.metawatch.org/forums/thread/492/metawatchmanager-rm15-updated-10-june?page=4#dis-post-3354 )

benjymous avatar Jun 15 '12 15:06 benjymous

This should be partially fixed now, by attempting to time the round trip from a getRealTimeClock to its response, always pushing the getRealTimeClock message to the head of the send queue, to make sure it gets sent asap, and adding on some time to adjust, based on the round trip.

Sadly can only adjust on a whole-second basis, so it's not perfect, but it seems to get the time on the watch within half a second of the phone, rather than a few seconds out.

benjymous avatar Jun 16 '12 09:06 benjymous