core: deprecate old MAVLink interception API and MavlinkPassthrough for v4#2917
Open
bansiesta wants to merge 26 commits into
Open
core: deprecate old MAVLink interception API and MavlinkPassthrough for v4#2917bansiesta wants to merge 26 commits into
bansiesta wants to merge 26 commits into
Conversation
julianoes
reviewed
Jul 12, 2026
julianoes
previously approved these changes
Jul 12, 2026
… plugins respect drops Plugins like FTP and Telemetry register handlers via register_mavlink_message_handler (old path) and are dispatched in process_message, not process_libmav_message. The JSON interception callbacks were only checked in process_libmav_message, so returning false from subscribe_incoming_messages_json had no effect on those plugins. Move the JSON intercept check into process_message (after _mutex is released, before plugin dispatch), using the same mavlink_message_t → Mavsdk::MavlinkMessage conversion pattern already used in deliver_message for outgoing intercept. Remove the check from process_libmav_message to avoid invoking each callback twice for the same physical packet (dual-parser architecture calls both paths per datagram). This fixes: - Intercept.IncomingDrop: GLOBAL_POSITION_INT now blocked before Telemetry sees it - Ftp.DownloadBurstStopAndTryAgain / DownloadStopAndTryAgain / UploadStopAndTryAgain: FTP plugin now sees the drop and the first transfer times out as expected Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- mavsdk_impl.cpp: clang-format style fixes (collapse multi-line conditions to single lines) - docs: regenerate MavlinkPassthrough and Mavsdk API docs to reflect deprecation markers and new JSON subscription methods - examples/CMakeLists.txt: allow -Wno-error=deprecated-declarations so examples that intentionally demonstrate deprecated APIs still build under -Werror Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
0df6f6a to
76bb3b4
Compare
The JSON intercept must fire before forward_message() so that a dropped message is neither forwarded to connected peers nor delivered to local plugins. Moving it inside the _mutex block (after the legacy intercept_incoming_messages_async check, before forward_message) fixes the Intercept.IncomingDrop system test which was seeing the forwarded packet land on the receiver even after the interceptor dropped it. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…cessing Intercept semantics: messages are still forwarded to connected peers as a raw relay; the subscribe_incoming_messages_json callback only controls whether local plugins (Telemetry, FTP, etc.) receive the message. Update Intercept.IncomingDrop test to match: only assert that the interceptor's own Telemetry plugin does NOT receive the dropped message. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Marks the old MAVLink APIs as deprecated ahead of v4:
Mavsdk::intercept_incoming_messages_async()— usesubscribe_incoming_messages_json()insteadMavsdk::intercept_outgoing_messages_async()— usesubscribe_outgoing_messages_json()insteadMavlinkPassthroughclass — useMavlinkDirectinsteadThe JSON-based replacements were added in #2638, which stated the old API would be replaced "by the next major release". MavlinkPassthrough already had a docstring warning; this adds the machine-readable
[[deprecated]]attribute so compilers emit warnings at call sites.