Repository navigation
BMG transport: the FTDI interface shared by BMG's readers - #1535
Merged
Merged
Conversation
The FTDI link of CLARIOstarDriver - opening the port, writing a frame and reading exactly one reply frame back through the queued bulk-in reads or libftdi, purge and drain - moves to pylabrobot/bmg_labtech/transport/ as BMGFTDIInterface, taking the reader's header byte, baud rate and reply-read timeouts; the queued reads move with it. The CLARIOstar keeps its measured timeouts, the exchange lock, the retries and its USB interface, builds the FTDI interface on first use over its current io, and sends and reads the same bytes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
BioCam
force-pushed
the
bmg-labtech-shared-ftdi-link
branch
from
October 23, 2026 18:12
a7a64e4 to
b496d5b
Compare
BioCam
marked this pull request as ready for review
October 23, 2026 18:42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Problem
CLARIOstarDriverholds its whole FTDI interface: opening the port, reading exactly one reply frame back (the size field ends it, as CR also occurs inside payloads), the bulk-in transfers kept pending so no byte is lost, purge and drain. None of it is the CLARIOstar's beyond its header byte0x0Cand its baud rate: it is how a BMG reader is read over FTDI, so another BMG driver would have to copy about 300 lines of the hardest code to get right, or import it from the CLARIOstar.PR Content
pylabrobot/bmg_labtech/transport/ftdi_interface.py:BMGFTDIInterface(io, *, header, baudrate, packet_read_timeout, frame_stall_timeout, frame_hard_cap)withsetup(),exchange(payload),purge_rx(),drain_rx(),stop()-CLARIOstarDriver's FTDI code, moved, with the reader's header byte, baud rate and reply-read timeouts as arguments, none defaulted.pylabrobot/bmg_labtech/transport/ftdi_queued_reads.py: moved unchanged fromclariostar/driver/.CLARIOstarDriverkeeps its measured timeouts (1 s to a reply's start, 2 s stall, 60 s cap), builds the FTDI interface on first use over its current io with those andheader=0x0C, baudrate=125000, and keeps the exchange lock, the retries, its USB interface and the choice between the two;send_commandand the features are unchanged, and the CLARIOstar sends and reads the same bytes.pylabrobot.bmg_labtech.transport.ftdi_interface.🤖 Generated with Claude Code