Skip to content

Enable forwarding unknown messages#2637

Merged
julianoes merged 1 commit intomainfrom
pr-forward-unknown-messages
Aug 14, 2025
Merged

Enable forwarding unknown messages#2637
julianoes merged 1 commit intomainfrom
pr-forward-unknown-messages

Conversation

@julianoes
Copy link
Copy Markdown
Collaborator

This fixes the problem that MAVSDK did not forward messages which it had not seen before. This could happen when:

  • A message is added in a later version of MAVLink whchi MAVSDK hasn't shipped with,
  • A custom message needs to be forwarded that MAVSDK doesn't know about.

@julianoes julianoes force-pushed the pr-forward-unknown-messages branch from 48f8b59 to e7ba310 Compare August 4, 2025 04:47
@julianoes julianoes force-pushed the pr-forward-unknown-messages branch from e7ba310 to 4de47b5 Compare August 4, 2025 04:54
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Aug 4, 2025

Copy link
Copy Markdown
Collaborator Author

@julianoes julianoes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Self reviewed again, I think it's ok.

#if defined(LINUX) || defined(APPLE)
send_len = static_cast<int>(write(_fd, bytes, length));
#else
if (!WriteFile(_handle, bytes, static_cast<DWORD>(length), LPDWORD(&send_len), NULL)) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this a Windows function? 🤔

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe so. It was there before, it just moved.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh you're right. So I guess we don't use this function on iOS or Android 🤷

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No idea.

@julianoes julianoes merged commit 3a9af63 into main Aug 14, 2025
72 of 76 checks passed
@julianoes julianoes deleted the pr-forward-unknown-messages branch August 14, 2025 00:13
@hamishwillee
Copy link
Copy Markdown
Collaborator

This is cool!

julianoes added a commit that referenced this pull request Dec 10, 2025
This fixes a major flaw that was introduced with
#2637 leading to invalid messages
being parsed, instead of only forwarded, as was the intention.

The fix is to:
- Process and forward if CRC is valid
- forward only if CRC is invalid (for unknown or invalid message)
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.

3 participants