MWM-for-Android
MWM-for-Android copied to clipboard
Latency with sendRtcNow()
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 )
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.