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.

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