Skip to content

pcan: skip controller status messages on receive - #2133

Open
lizaolahoaglund wants to merge 1 commit into
hardbyte:mainfrom
lizaolahoaglund:pcan-skip-status-messages
Open

lizaolahoaglund wants to merge 1 commit into
hardbyte:mainfrom
lizaolahoaglund:pcan-skip-status-messages

Conversation

@lizaolahoaglund

@lizaolahoaglund lizaolahoaglund commented Nov 17, 2026 •

Copy link
Copy Markdown

Summary of Changes

PCAN-Basic can return PCAN_ERROR_OK for a controller status notification, for example when the controller is activated. PcanBus.recv() currently turns that notification into a CAN message, even though its ID and length don't describe a CAN frame.

Skip entries marked PCAN_MESSAGE_STATUS and keep reading within the receive timeout. The regression tests cover Classic CAN and CAN FD, including a data frame queued behind a status notification.

PCAN-Basic status frame documentation

Type of Change

  • Bug fix

Checklist

  • I have followed the contribution guide.
  • I have added or updated tests as appropriate.
  • I have added a news fragment for towncrier.
  • PCAN regression tests passed with tox on Windows.

PCAN-Basic can return PCAN_ERROR_OK with the PCAN_MESSAGE_STATUS bit set, for example when the CAN controller is activated. The ID and length fields in a status message do not describe a CAN frame.

Skip status messages before constructing a Message. Continue reading queued frames while respecting the receive timeout.
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