From 7436974e2fc5b63fc65d5d16d8239dffa05b3ea1 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 21 Nov 2012 14:11:05 +1100 Subject: [PATCH] MAVLink: make it possible to enter the CLI over the radio this only works on the APM2, where UART0 is also the radio port --- APMrover2/GCS_Mavlink.pde | 6 +++++- ArduCopter/GCS_Mavlink.pde | 6 +++++- ArduPlane/GCS_Mavlink.pde | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/APMrover2/GCS_Mavlink.pde b/APMrover2/GCS_Mavlink.pde index a026ad68be..7f7845f6aa 100644 --- a/APMrover2/GCS_Mavlink.pde +++ b/APMrover2/GCS_Mavlink.pde @@ -763,7 +763,11 @@ GCS_MAVLINK::update(void) // Try to get a new message if (mavlink_parse_char(chan, c, &msg, &status)) { - mavlink_active = 1; + // we exclude radio packets to make it possible to use the + // CLI over the radio + if (msg.msgid != MAVLINK_MSG_ID_RADIO) { + mavlink_active = true; + } handleMessage(&msg); } } diff --git a/ArduCopter/GCS_Mavlink.pde b/ArduCopter/GCS_Mavlink.pde index 0717d8fcb5..cb5c0b44d0 100644 --- a/ArduCopter/GCS_Mavlink.pde +++ b/ArduCopter/GCS_Mavlink.pde @@ -806,7 +806,11 @@ GCS_MAVLINK::update(void) // Try to get a new message if (mavlink_parse_char(chan, c, &msg, &status)) { - mavlink_active = true; + // we exclude radio packets to make it possible to use the + // CLI over the radio + if (msg.msgid != MAVLINK_MSG_ID_RADIO) { + mavlink_active = true; + } handleMessage(&msg); } } diff --git a/ArduPlane/GCS_Mavlink.pde b/ArduPlane/GCS_Mavlink.pde index 15a128db00..8c8ca127d4 100644 --- a/ArduPlane/GCS_Mavlink.pde +++ b/ArduPlane/GCS_Mavlink.pde @@ -804,7 +804,11 @@ GCS_MAVLINK::update(void) // Try to get a new message if (mavlink_parse_char(chan, c, &msg, &status)) { - mavlink_active = 1; + // we exclude radio packets to make it possible to use the + // CLI over the radio + if (msg.msgid != MAVLINK_MSG_ID_RADIO) { + mavlink_active = true; + } handleMessage(&msg); } }