Skip to content

Sign-extend 1-byte signed integer device attributes - #500

Merged
jadamcrain merged 1 commit into
mainfrom
fix/497-signed-int-attrs
Oct 19, 2026
Merged

jadamcrain merged 1 commit into
mainfrom
fix/497-signed-int-attrs

Conversation

@jadamcrain

Copy link
Copy Markdown
Member

Closes #497.

The master read a 1-byte signed integer attribute as unsigned, so -1 came
back as 255. The outstation sends values from -128 to 126 in one byte, so
the library's own master and outstation disagreed.

Read the byte with u8::cast_signed, which needs Rust 1.87, so raise the
minimum supported Rust version from 1.85 to 1.87. Clippy's
manual_is_multiple_of lint applies at 1.87, so use is_multiple_of in the two
places it flags.

Closes #497.
@jadamcrain jadamcrain added the conformance Run the conformance tests on this PR label Oct 19, 2026
@jadamcrain
jadamcrain merged commit 3405a42 into main Oct 19, 2026
40 checks passed
@jadamcrain
jadamcrain deleted the fix/497-signed-int-attrs branch October 19, 2026 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conformance Run the conformance tests on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Master: 1-byte signed integer attributes aren't sign-extended

1 participant