Skip to content

Commit

Permalink
GCSViews: Add sysid target to safety switch command
Browse files Browse the repository at this point in the history
  • Loading branch information
stephendade authored and meee1 committed Sep 22, 2023
1 parent 1108eb4 commit 9d0e6c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion GCSViews/FlightData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1688,7 +1688,7 @@ private void BUTactiondo_Click(object sender, EventArgs e)
if (CMB_action.Text == actions.Toggle_Safety_Switch.ToString())
{
var custom_mode = (MainV2.comPort.MAV.cs.sensors_enabled.motor_control && MainV2.comPort.MAV.cs.sensors_enabled.seen) ? 1u : 0u;
var mode = new MAVLink.mavlink_set_mode_t() { custom_mode = custom_mode };
var mode = new MAVLink.mavlink_set_mode_t() { custom_mode = custom_mode, target_system = (byte)MainV2.comPort.sysidcurrent };
MainV2.comPort.setMode(mode, MAVLink.MAV_MODE_FLAG.SAFETY_ARMED);
((Control)sender).Enabled = true;
return;
Expand Down

0 comments on commit 9d0e6c5

Please sign in to comment.