fix(mavlink2-bridge): honor ?proto= query on the serial transport - #3098
fix(mavlink2-bridge): honor ?proto= query on the serial transport#3098phil-opp wants to merge 1 commit into
?proto= query on the serial transport#3098Conversation
The serial connection path hardcoded MavlinkVersion::V2 via the open_mavlink wrapper, silently ignoring a ?proto= override that the tcp:// and udp:// paths both honor. A user passing serial:///dev/ttyUSB0?baud=57600&proto=v1 got a V2 connection with no error or warning. Route connect_serial through parse_proto_query like the other two schemes, delete the now-dead open_mavlink wrapper, and document the previously-undocumented proto query parameter in the module docs. Adds unit tests covering proto parsing and the serial URL case. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1Fmp8pELuTiPGTStomkZj
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
Automated review run — summaryThis is the summary for a batch of machine-generated PRs opened by Claude (Claude Code) from an in-depth review of the repo against a freshly-fetched PRs by categoryCorrectness
Documentation
Optimization
Rejected / not-pursued findings (one-line reasons)
Generated by Claude Code |
|
🤖 Automated review by Claude Code — fully automated review, not vetted by a human. No blocking issues found. The fix is correct: Two smaller notes, neither blocking:
Generated by Claude Code |
Issue
The MAVLink transport builder (
libraries/extensions/mavlink2-bridge/src/transport.rs) accepts an optional?proto=query parameter to select the MAVLink wire version.connect_tcpandconnect_udpboth read it viaparse_proto_query(url).unwrap_or(MavlinkVersion::V2), butconnect_serialrouted through theopen_mavlinkwrapper, which hardcodedMavlinkVersion::V2:So a user connecting with
serial:///dev/ttyUSB0?baud=57600&proto=v1silently got a MAVLink V2 connection — no error, no warning — while the exact same override works ontcp://andudp://. Theprotoparameter was also completely undocumented (the module docs coverbaudbut never mentionproto).Fix
connect_serialthroughparse_proto_query(url).unwrap_or(MavlinkVersion::V2)andopen_mavlink_versioned, exactly like the tcp/udp paths.open_mavlinkwrapper (its only caller wasconnect_serial).protoquery parameter (accepted spellings + default) in the module docs.No behavior change for tcp/udp or for serial connections that omit
proto; the default remains MAVLink V2.Validation
parses_proto_query_variants,parses_proto_query_missing_or_garbage, andserial_url_honors_proto_query(regression guard for the serial branch).cargo +1.97.1 fmt -p dora-mavlink2-bridge -- --check— clean.cargo +1.97.1 clippy -p dora-mavlink2-bridge -- -D warnings— clean.cargo +1.97.1 test -p dora-mavlink2-bridge— all pass (incl. doctests).🤖 Generated with Claude Code
Generated by Claude Code