Skip to content

Use 64-bit PCAN buffers only for acceptance filter parameters - #2143

Merged
zariiii9003 merged 2 commits into
hardbyte:mainfrom
Solarboaters:fix/pcan-parameter-buffer-size
Nov 22, 2026
Merged

zariiii9003 merged 2 commits into
hardbyte:mainfrom
Solarboaters:fix/pcan-parameter-buffer-size

Conversation

@Solarboaters

@Solarboaters Solarboaters commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary of Changes

Fix PCAN parameter buffer selection in GetValue and SetValue: only the two acceptance-filter parameters use an eight-byte buffer; ordinary integer parameters use four bytes. String handling is unchanged.

Related Issues / Pull Requests

Type of Change

  • Bug fix

Checklist

  • I have followed the contribution guide.
  • I have added or updated tests as appropriate.
  • I have added or updated documentation as appropriate.
  • I have added a news fragment for towncrier.
  • All checks and tests pass (tox).

Additional Notes

The buffer regressions now live in test/test_pcan.py, as requested, and doc/changelog.d/2143.fixed.rst describes the fix. The follow-up changes test organisation and the release note only.

Revalidated on Python 3.12: replacing can/interfaces/pcan/basic.py with its original version from 2aec6d66d28c24559cc1961d901c864d2f5b9e4e makes the six ordinary-parameter cases fail; the six filter/string controls pass. With the fix, python -m pytest -o addopts= -q test/test_pcan.py passes 60 tests and 24 subtests. Black (whole repository), configured Ruff scope (can examples doc) and diff whitespace checks pass.

Tests exercise the real PCANBasic wrapper through a simulated driver, checking buffer sizes and reading/writing values. There was no physical adapter or installed PCAN driver test, and no claim that every driver rejects the previous size. The full local tox matrix was not run. AI-assisted implementation and testing.

@zariiii9003

Copy link
Copy Markdown
Collaborator

Move the tests into test_pcan.py and add a news fragment.

@Solarboaters

Solarboaters commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor Author

Done in 5a2f656: moved the buffer tests into test/test_pcan.py and added 2143.fixed.rst. The PCAN suite passes 60 tests and 24 subtests; the six original buffer-size failures still reproduce without the fix. Update: CI and the documentation build have passed on this head.

@zariiii9003 zariiii9003 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you

@zariiii9003
zariiii9003 merged commit c1649c3 into hardbyte:main Nov 22, 2026
28 checks 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.

GetValue: filter check is always true, so every parameter gets a 64-bit buffer

2 participants