fix(telemetry): match INAV's flight-mode reporting in the relay encoders - #32
Open
b14ckyy wants to merge 1 commit into
Open
fix(telemetry): match INAV's flight-mode reporting in the relay encoders#32b14ckyy wants to merge 1 commit into
b14ckyy wants to merge 1 commit into
Conversation
…encoders The LTM/CRSF/S.Port relay encoders collapsed the unified flight-mode bitfield in an ad-hoc order, so combined modes reported differently from what INAV itself sends over the same telemetry type (launch during cruise, autoland during RTH, angle+althold, ...). All three now follow the INAV encoder sources verbatim: - LTM: ltm_sframe() chain — manual first, autoland last, HEADFREE included, RATE (1) fallback instead of ACRO (4) - CRSF: crsfFrameFlightMode() chain + vocabulary — "AH" = alt hold (was wrongly labelled "ANGH", which is INAV's angle-hold MODE), CRSH vs CRUZ distinction, LAND/TURT, disarmed "!ERR" when arming is blocked - S.Port: frskyGetFlightMode() decimal columns incl. the else-chains that keep every column a single digit (RTH+WP+course hold could previously overflow the thousands column into its neighbour), the readiness ones digit, and the HEADFREE/TURTLE/ANGLEHOLD columns Decode side: the FrSky decoder reads the TURTLE and ANGLEHOLD columns, the CRSF decoder maps "ANGH" to the new anglehold mode (not althold), "LAND" to RTH+autoland and "TURT" to turtle; classify_inav knows both new modes and the frontend registry renders them. parse_active_modes/box_active no longer guess modes while MSP_BOXIDS is missing — a raw bit index is not a permanent box id, and the guess produced confidently wrong modes (and could false-trigger the RC override). Their per-frame eprintln! diagnostics moved to log::debug!. Unit tests pin all three collapses against the INAV chains and round-trip S.Port encode -> decode. Co-Authored-By: Claude Opus 4.8
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 relay encoders (LTM / CRSF / S.Port) now collapse combined flight modes exactly like INAV's own telemetry encoders — the chains are taken verbatim from
telemetry/ltm.c,telemetry/crsf.candtelemetry/smartport.c. Combined modes (Angle+AltHold, Horizon+AltHold, AngleHold+AltHold, launch during cruise, autoland during RTH) now report identically to a real INAV FC on the same link type.anglehold+turtleend-to-end (classify → registry → widget/track colors)Checks:
cargo checkclean,cargo test94 passed,npm run check0/0.