Yeah sorry, I'm not sure, I don't think I've tried that exact scenario.
> I have had success writing session data in onTimerStop()
Based on this, it's not too crazy to imagine that you could…
Hi
Just found out myself, that onTimerReset gets called in the SIM but not on my 935 )-:
Shouldn't this be reported as a bug, at least the SIM should give the same result as the real device in such basic events.
So sad I reproduced it on fenix7 and epix2pro these so-called high-end models. This is my bug report. https://forums.garmin.com/developer/connect-iq/i/bug-reports/ontimerreset-not-called-in-a-datafield-on-fenix7
do you know if calling setData for a lap field will write out if you do it within the onTimerStop() callback?
i have a specific use case in mind where I only need to call setData once regardless of how many laps there are (bc I just want the columns to show up in Garmin Connect), and I would prefer to just call it within onTimerStop bc I have some extra logic for determining if the fields should be written
Hey, I just wanted to say thanks for all the help you’ve provided in the forums, I’ve learned a lot from some of your posts.
Sometimes your tone comes off harsh, this makes the experience of reading the forums less enjoyable and discourages positive productive interactions.
This isn’t the first time I’ve felt this way after reading one of your replies, so I figured it was worth sharing this feedback.
If you re-read the original post and then my follow-up question, I think you'll see that the original post doesn’t actually address the technically nuanced point I was asking about.
do you know if calling setData for a lap field will write out if you do it within the onTimerStop() callback?
It might set data for the final lap, not the lap summary data row as you asked about elsewhere. As far as I know, it's impossible for CIQ fields to set data for the lap summary row. Connect is smart enough to know which native session field correspond with a given native lap, but there doesn't seem to be a corresponding mechanism to tie together CIQ lap and session fields.
But back to your actual question and my answer (which is "maybe")..My reasoning is that the general rule for FIT lap data seems to be that setData() has to be called before the end of the lap in question. e.g. You have to call setData() for Lap 1's data before the first onTimerLap() event (a common noob mistake is to call it within the first onTimerLap() event itself)
Ofc, the final lap is a little different, as you never get an onTimerLap() event for the end of the final lap in any case - the final lap ends when the activity ends.
So I don't know what happens if the user stops the timer (for the first and only time) and subsequently ends the activity. Does the "end of the final lap" occur just before/at onTimerStop() or does it occur "after" onTimerStop()? If we knew the answer to that question, we could probably tell for sure without trying.
TL;DR maybe, but the only way you'll know for sure is if you try it for yourself.
It might set data for the final lap,
ok gotcha yeah makes sense, will give it a shot and let you know! I was mainly asking in case you tried already and knew the answer hah
Yeah sorry, I'm not sure, I don't think I've tried that exact scenario.
> I have had success writing session data in onTimerStop()
Based on this, it's not too crazy to imagine that you could write data for the final lap in onTimerStop() as well.
Let me know if it works!
Ofc, not to state the obvious, but if the goal is to only write data for the final lap, you have no way of preventing previous laps from being set in some situations, as you can't prevent the user from starting the timer after they stop it.