Skip to content

Refactor SerialManager to dynamic drivers + transport; add identify() and fix logger duplication#1

Merged
MarkoVcode merged 2 commits into
developfrom
developing_drivers
Sep 30, 2025
Merged

Refactor SerialManager to dynamic drivers + transport; add identify() and fix logger duplication#1
MarkoVcode merged 2 commits into
developfrom
developing_drivers

Conversation

@MarkoVcode
Copy link
Copy Markdown
Owner

Summary

  • Refactor SerialManager to dynamically load devices from config.yaml and instantiate driver classes via dynamic import
  • Introduce shared SerialTransport abstraction to handle serial settings and EOLs
  • Update existing drivers (owon_oel, owon_spm, owon_xdm, tenma_psu) to use the transport and implement identify() issuing *IDN?
  • Fix logger duplication by preventing duplicate handlers and disabling propagation
  • Add tests that mock pyserial via transport to validate identify() and SerialManager behavior

Changes

  • benchmesh-serial-service/src/benchmesh_service/transport.py (new): SerialTransport, parse_serial_mode
  • benchmesh-serial-service/src/benchmesh_service/serial_manager.py: dynamic driver import, manifest EOL injection, config.yaml loading
  • benchmesh-serial-service/src/benchmesh_service/drivers/owon_oel.py: use transport, implement identify()
  • benchmesh-serial-service/src/benchmesh_service/drivers/owon_spm.py: use transport, implement identify()
  • benchmesh-serial-service/src/benchmesh_service/drivers/owon_xdm.py: use transport, implement identify()
  • benchmesh-serial-service/src/benchmesh_service/drivers/tenma_psu.py: use transport, implement identify()
  • benchmesh-serial-service/src/benchmesh_service/logger.py: avoid duplicate handlers, disable propagation
  • benchmesh-serial-service/tests/test_driver_identify.py (new): tests identify() per driver
  • benchmesh-serial-service/tests/test_serial_manager.py: updated to mock transport-level serial

Testing

  • All tests pass locally: pytest -q benchmesh-serial-service/tests

Notes

  • No changes to manifests or config.yaml.
  • TENMA driver uses manifest alias tenma_psu -> tenma_72 for manifest lookup.

Co-authored-by: openhands openhands@all-hands.dev

…nd instantiate drivers via dynamic import; add shared SerialTransport and identify() in drivers; update tests to mock transport serial\n\nCo-authored-by: openhands <openhands@all-hands.dev>
…oid repeated log lines\n\nCo-authored-by: openhands <openhands@all-hands.dev>
@MarkoVcode MarkoVcode merged commit a1ba8d0 into develop Sep 30, 2025
2 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.

2 participants