Skip to content

Stop read() discarding frames whose data is all 0xFF - #3

Merged
willzhang05 merged 1 commit into
mainfrom
fix/read-keeps-unanswered-headers
Oct 10, 2026
Merged

willzhang05 merged 1 commit into
mainfrom
fix/read-keeps-unanswered-headers

Conversation

@willzhang05

Copy link
Copy Markdown
Member

An unanswered header is reported by the device as a frame with recessive 0xFF data and SLV_NOT_RSP | TIMEOUT in the flags. read() treated that data pattern as an invalid read and returned None, so a passive logger never saw a single empty poll -- the master's polling cadence was invisible. The same check also hid any slave that legitimately answered with 0xFF bytes.

read() now returns every record the driver queues (FRAME and the SLEEP / WAKEUP / OVERRUN events alike), returns None only for a non-blocking read that finds nothing or a short record, and no longer swallows every exception. Version 0.0.4.

An unanswered header is reported by the device as a frame with recessive
0xFF data and SLV_NOT_RSP | TIMEOUT in the flags. read() treated that
data pattern as an invalid read and returned None, so a passive logger
never saw a single empty poll -- the master's polling cadence was
invisible. The same check also hid any slave that legitimately answered
with 0xFF bytes.

read() now returns every record the driver queues (FRAME and the SLEEP /
WAKEUP / OVERRUN events alike), returns None only for a non-blocking
read that finds nothing or a short record, and no longer swallows every
exception. Version 0.0.4.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@willzhang05
willzhang05 merged commit 168839b into main Oct 10, 2026
@willzhang05
willzhang05 deleted the fix/read-keeps-unanswered-headers branch October 10, 2026 01:56
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