From 9b2ad5577335ae3ae896e77cc9b123701cc1434b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 31 Aug 2012 12:09:24 +1000 Subject: [PATCH] APM: added forwarding of unknown MAVLink types --- ArduPlane/GCS_Mavlink.pde | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ArduPlane/GCS_Mavlink.pde b/ArduPlane/GCS_Mavlink.pde index d5169eef52..a21687bca7 100644 --- a/ArduPlane/GCS_Mavlink.pde +++ b/ArduPlane/GCS_Mavlink.pde @@ -1937,6 +1937,18 @@ mission_failed: break; } + default: + // forward unknown messages to the other link if there is one + if ((chan == MAVLINK_COMM_1 && gcs0.initialised) || + (chan == MAVLINK_COMM_0 && gcs3.initialised)) { + mavlink_channel_t out_chan = (mavlink_channel_t)(((uint8_t)chan)^1); + // only forward if it would fit in our transmit buffer + if (comm_get_txspace(out_chan) > msg->len + MAVLINK_NUM_NON_PAYLOAD_BYTES) { + _mavlink_resend_uart(out_chan, msg); + } + } + break; + } // end switch } // end handle mavlink