Skip to content
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

commander: fix arming auth param translation #12698

Merged
merged 2 commits into from
Aug 14, 2019
Merged

commander: fix arming auth param translation #12698

merged 2 commits into from
Aug 14, 2019

Conversation

julianoes
Copy link
Contributor

@julianoes julianoes commented Aug 14, 2019

The int32 param COM_ARM_AUTH is mapped to a packed struct. However, this struct was not actually packed (anymore) and therefore the values were applied incorrectly.

I fixed this by applying the packed attribute. By using a union with a int32_t I could rid of the warning about address-of-packed-member.

This also fixes the issue where sysid and compid in the mavlink_command_sender do not match because the target_system and target_component are 0 (to all). This meant that the command was being re-transmitted multiple times even though an ack was received.

Tested in SITL so far.

Fixes #12685.

The int32 param COM_ARM_AUTH is mapped to a packed struct. However, this
struct was not actually packed (anymore) and therefore the values were
applied incorrectly.

I fixed this by applying the packed attribute. By using a union with a
int32_t I could rid of the warning about address-of-packed-member.
When we send a command to any sysid or any compid, we need to match an
ack from a specific sysid or compid. If we don't do that, we keep
sending retransmissions and eventually time out.
@dagar dagar merged commit 82bee2b into master Aug 14, 2019
@dagar dagar deleted the fix-arm-auth branch August 14, 2019 17:29
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.

Arm authorization fails on first attempt, succeeds erroneously after
2 participants