Skip to content

Commit

Permalink
MAVLinkInterface: dont attempt command on closed port
Browse files Browse the repository at this point in the history
  • Loading branch information
meee1 committed Dec 1, 2022
1 parent f7f7764 commit 8ec26f7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ExtLibs/ArduPilot/Mavlink/MAVLinkInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2533,6 +2533,9 @@ public async Task<bool> doCommandAsync(byte sysid, byte compid, MAV_CMD actionid
float p4,
float p5, float p6, float p7, bool requireack = true, Action uicallback = null)
{
if (BaseStream == null || BaseStream.IsOpen == false)
return false;

MAVLinkMessage buffer;

mavlink_command_long_t req = new mavlink_command_long_t
Expand Down Expand Up @@ -2690,6 +2693,9 @@ public async Task<bool> doCommandIntAsync(byte sysid, byte compid, MAV_CMD actio
int p5, int p6, float p7, bool requireack = true, Action uicallback = null,
MAV_FRAME frame = MAV_FRAME.GLOBAL)
{
if (BaseStream == null || BaseStream.IsOpen == false)
return false;

MAVLinkMessage buffer;

mavlink_command_int_t req = new mavlink_command_int_t()
Expand Down

0 comments on commit 8ec26f7

Please sign in to comment.