Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Garmin: Report correct local time offset #69

Merged
merged 1 commit into from
Dec 26, 2024

Conversation

torvalds
Copy link
Collaborator

We stupidly thought that the local time offset was in the "DEVICE_SETTINGS" message as the time_offset field. I'm pretty sure I've seen something like that before.

But the FIT files from github issue #4401 clearly have that time offset field being zero, and there are two other ways to figure out what local time actually is, namely in the "local_time" field of the ACTIVITY message or the TIMESTAMP_CORRELATION message.

Either of those seem to work for what we want, so let's parse both (we already did the ACTIVITY case), and let's ignore the "time_offset" field from DEVICE_SETTINGS at least if it is zero.

There is probably some real explanation for what the proper way to deal with all this is, and what the whole time_offset and utc_offset fields from DEVICE_SETTINGS means, and maybe we can improve on this in the future if somebody figures it all out.

In the meantime, this seems to be an improvement.

Reported-by: @WetsuitSeasoning
Link: subsurface/subsurface#4401

We stupidly thought that the local time offset was in the
"DEVICE_SETTINGS" message as the time_offset field.  I'm pretty sure
I've seen something like that before.

But the FIT files from github issue #4401 clearly have that time offset
field being zero, and there are two other ways to figure out what local
time actually is, namely in the "local_time" field of the ACTIVITY
message or the TIMESTAMP_CORRELATION message.

Either of those seem to work for what we want, so let's parse both (we
already did the ACTIVITY case), and let's ignore the "time_offset" field
from DEVICE_SETTINGS at least if it is zero.

There is probably some real explanation for what the proper way to deal
with all this is, and what the whole time_offset and utc_offset fields
from DEVICE_SETTINGS means, and maybe we can improve on this in the
future if somebody figures it all out.

In the meantime, this seems to be an improvement.

Reported-by: @WetsuitSeasoning
Link: subsurface/subsurface#4401
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Copy link
Collaborator

@dirkhh dirkhh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks reasonable and doesn't appear to break the test downloads that I did with it.

@dirkhh dirkhh merged commit b9a2f35 into subsurface:Subsurface-DS9 Dec 26, 2024
8 checks passed
@subsurface subsurface deleted a comment from 2lambda123 Dec 28, 2024
@subsurface subsurface deleted a comment from t00t4 Dec 28, 2024
@subsurface subsurface locked as resolved and limited conversation to collaborators Dec 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants