Skip to content

Conversation

@MartB
Copy link
Contributor

@MartB MartB commented Dec 26, 2025

Thread defines the Timestamp Ticks field as 15 bits. The parser was using a mask of 0x7FF (11 bits), which truncated higher tick values.

This changes the mask to 0x7FFF to correctly decode the full 15-bit value.

Related to home-assistant/core#134306
If this ends up being merged, bumping the dependency of the thread component would be nice!

Thread defines the Timestamp Ticks field as 15 bits. The parser was using a mask of `0x7FF` (11 bits), which truncated higher tick values.

This changes the mask to `0x7FFF` to correctly decode the full 15-bit value.

Related to home-assistant/core#134306
@lboue
Copy link

lboue commented Dec 26, 2025

That seems correct to me; it corresponds to what we find here: timestamp.hpp#L179-L180

    static constexpr uint8_t  kTicksOffset         = 1;
    static constexpr uint16_t kTicksMask           = 0x7fff << kTicksOffset;

Copy link

@lboue lboue left a comment

Choose a reason for hiding this comment

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

LGTM

@emontnemery
Copy link
Collaborator

@MartB You really should create a topic branch for PRs instead of submitting PRs from your fork's main branch (for your own sake, it doesn't matter for us).

Copy link
Collaborator

@emontnemery emontnemery left a comment

Choose a reason for hiding this comment

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

LGTM, thanks a lot for fixing this @MartB 👍

@emontnemery emontnemery merged commit f766982 into home-assistant-libs:main Jan 8, 2026
1 check passed
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.

3 participants