Skip to content

Allow companion BLE/USB CMD_SET_DEVICE_TIME to set clock backwards - #3195

Open
estebanscdev wants to merge 1 commit into
meshcore-dev:devfrom
estebanscdev:fix/3173-companion-clock-backwards-v2
Open

Allow companion BLE/USB CMD_SET_DEVICE_TIME to set clock backwards#3195
estebanscdev wants to merge 1 commit into
meshcore-dev:devfrom
estebanscdev:fix/3173-companion-clock-backwards-v2

Conversation

@estebanscdev

Copy link
Copy Markdown

CMD_SET_DEVICE_TIME only ever arrives from the locally-paired companion app/CLI, not from untrusted mesh peers, so the owner should be able to correct a drifted device clock in either direction. Previously a fast- running clock (e.g. software fallback clock on nRF52 boards with no GPS fix or RTC chip, after long uptime) could never be corrected once it drifted ahead, since the firmware rejected any earlier timestamp.

Fixes #3173

CMD_SET_DEVICE_TIME only ever arrives from the locally-paired companion
app/CLI, not from untrusted mesh peers, so the owner should be able to
correct a drifted device clock in either direction. Previously a fast-
running clock (e.g. software fallback clock on nRF52 boards with no
GPS fix or RTC chip, after long uptime) could never be corrected once
it drifted ahead, since the firmware rejected any earlier timestamp.

Fixes meshcore-dev#3173
@ErikBrown2

Copy link
Copy Markdown

Thanks for this modification. I hope that it will be accepted because it really solves a headache. My client always checks the time at startup and tries to correct it if it is more off than 10 seconds. But this never works due to the restriction of not being able to set an earlier time. I can see some logic in this rule but I think that it makes overall more sense to allow to set any time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants