Skip to content

Conversation

@hagz0r
Copy link

@hagz0r hagz0r commented Jan 4, 2026

This PR refactors the cd321x device logic to be transport-agnostic by introducing
a Transport trait, and moves the existing sysfs-based implementation into a
dedicated backend.

Motivation:

  • decouple protocol/device logic from the concrete I/O mechanism
  • make it possible to add alternative transports in the future
    (e.g. mock/testing, userspace bridges, other host OSes)
  • reduce cd321x-specific filesystem handling in higher-level code

Changes

  • introduce a Transport trait defining read/write semantics
  • rework cd321x::Device to operate on a generic Transport
  • move current sysfs implementation into transport::sysfs
  • no functional behavior changes intended

This is a pure refactor; behavior and command formats are unchanged.

Tested by building and running the tool against the existing sysfs backend.

@jannau
Copy link
Member

jannau commented Jan 20, 2026

Hej @hagz0r,
I was unfortunately not watching the repo and missed this PR. I will merge #4 first to drop the sysfs interface immediately. This will cause conflicts. If you're not motivated to fix them I can do it myself as penance for missing the PR. Please sign you commit with Developer Certificate of Origin so I can base it on your commit. The refactoring itself looks good, thanks I'm sorry for noticing it too late.

@hagz0r
Copy link
Author

hagz0r commented Jan 20, 2026 via email

@jannau
Copy link
Member

jannau commented Jan 20, 2026

thanks, please note that @bjarne-dietrich has already started looking into converting macvdmtool. I hope the work is mostly orthogonal so far and it can integrate with this transport refactoring.

@bjarne-dietrich
Copy link
Contributor

Hey Hagz0r,

Sorry, I didnt see your PR before. I will continue working on the macOS implementation meanwhile and integrate it once you are done.
Bjarne

Signed-off-by: hagz0r <smansm338@gmail.com>
@hagz0r hagz0r force-pushed the feat/transport-trait branch from 2626cdf to 183a7c5 Compare January 23, 2026 03:09
@hagz0r
Copy link
Author

hagz0r commented Jan 23, 2026

I wanted to clarify the testing situation for this PR.

At the moment I’m working on macOS and I’m also tied up with work commitments, so I can’t realistically run full Linux-side testing right now. Because of that, I’m currently limited to compile-time checks only. I should be able to properly test the changes on Linux hardware after the 26th.

If full testing is required sooner, I’d appreciate it if the maintainers could verify the changes on their side (e.g. via CI or a local Linux setup).

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