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

Backport net: sntp: Add option for SNTP uncertainty #22

Open
wants to merge 1 commit into
base: zp/v3.4.99-ncs1-branch
Choose a base branch
from

Conversation

JasperZP
Copy link

@JasperZP JasperZP commented Jan 5, 2024

Backport #66233 from zephyr:

SNTP response is not analyzed for uncertainty, and no uncertainty is given to the struct sntp_time returned. Fix it with a Kconfig option that adds optional SNTP uncertainty and timestamp fields in SNTP time struct, and calculates these when parsing the response.
Adds two helper functions to convert Q16.16/Q32.32 in seconds to int64_t in microseconds to facilitate this.
Also changes combined lvm field in struct sntp_pkt to bit-fields li, vn, and mode.

SNTP response is not analyzed for uncertainty, and no uncertainty is given
to the `struct sntp_time` returned. Fix it with a Kconfig option that adds
optional SNTP uncertainty and timestamp fields in SNTP time struct, and
calculates these when parsing the response.
Adds two helper functions to convert Q16.16/Q32.32 in seconds to `int64_t`
in microseconds to facilitate this.
Also changes combined `lvm` field in `struct sntp_pkt` to bit-fields
`li`, `vn`, and `mode`.

Signed-off-by: Jasper Smit <[email protected]>
@JasperZP JasperZP requested a review from IoannisPZP January 5, 2024 09:53
@JasperZP JasperZP self-assigned this Jan 5, 2024
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.

1 participant