-
Notifications
You must be signed in to change notification settings - Fork 13.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mavlink: improve comments about message forwarding #11323
Conversation
@julianoes Build failure: |
Wow, what was I thinking I could push with not enough semicolons 😄. |
f6f415e
to
dfeb6e0
Compare
This removes the confusing ugly magic number of 233 introduced as part of #7670. Also, the convoluted if is cleaned up using 3 separate bools with some comments to explain what's going on. This should not change anything function-wise except that the flight controller could now potentially also use system ID 233 and not break forwarding.
dfeb6e0
to
6197831
Compare
What's going on with CI?
|
Not sure, but I restated the job. |
Please review again since this passed CI now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice cleanup.
@@ -543,7 +543,7 @@ Mavlink::forward_message(const mavlink_message_t *msg, Mavlink *self) | |||
const mavlink_msg_entry_t *meta = mavlink_get_msg_entry(msg->msgid); | |||
|
|||
int target_system_id = 0; | |||
int target_component_id = 233; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is/was 233?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nobody knows, not even @sanderux who put it there initially.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I seem to remember this was some "all components" magic number but i cannot find any reference to it anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"All components" is 0 - https://mavlink.io/en/messages/common.html#MAV_COMP_ID_ALL
This is empty and unreserved. If it needs to be all components then it should be changed to zero. If it means something else then it will need a new component ID. As it is, we're likely to eventually overwrite this, and you will end up with unexpected behaviour.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes i realize that, i just can't imagine i made one up, nor can i imagine lorenz would have approved it if i did.
Thx @dagar! |
This removes the confusing ugly magic number of 233 introduced as part of #7670.
Also, the convoluted if is cleaned up using 3 separate bools with some comments to explain what's going on.
This should not change anything function-wise except that the flight controller could now potentially also use system ID 233 and not break forwarding.