Skip to content

Commit

Permalink
Plugins: example update
Browse files Browse the repository at this point in the history
  • Loading branch information
meee1 committed Feb 14, 2023
1 parent 278364d commit 5851582
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions plugins/generator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ public override bool Loop()
{
if (MainV2.comPort.BaseStream.IsOpen || MainV2.comPort.logreadmode)
{
if (sub == null)
if (sub == 0)
sub = MainV2.comPort.SubscribeToPacketType(MAVLink.MAVLINK_MSG_ID.GENERATOR_STATUS, message =>
{
MainV2.instance.BeginInvoke((MethodInvoker)delegate
Expand Down Expand Up @@ -447,8 +447,11 @@ public override bool Loop()
}
else
{
if (sub != null)
if (sub != 0)
{
MainV2.comPort.UnSubscribeToPacketType(sub);
sub = 0;
}
}

return true;
Expand All @@ -469,3 +472,4 @@ public override bool Exit()
}
}
}

0 comments on commit 5851582

Please sign in to comment.