From 35275aab85e64537fdd87904adab81f442429e82 Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Sat, 2 May 2015 21:38:58 +0900 Subject: [PATCH] Tracker: add support for 4th mavlink channel --- AntennaTracker/Parameters.h | 1 + AntennaTracker/Parameters.pde | 6 ++++++ AntennaTracker/system.pde | 6 ++++++ 3 files changed, 13 insertions(+) diff --git a/AntennaTracker/Parameters.h b/AntennaTracker/Parameters.h index 53698567e2..4a8d1656e7 100644 --- a/AntennaTracker/Parameters.h +++ b/AntennaTracker/Parameters.h @@ -92,6 +92,7 @@ public: k_param_pitch_range, k_param_distance_min, k_param_sysid_target, // 138 + k_param_gcs3, // stream rates for fourth MAVLink port // // 150: Telemetry control diff --git a/AntennaTracker/Parameters.pde b/AntennaTracker/Parameters.pde index 416caec6e8..a9aaa2626d 100644 --- a/AntennaTracker/Parameters.pde +++ b/AntennaTracker/Parameters.pde @@ -222,6 +222,12 @@ const AP_Param::Info var_info[] PROGMEM = { GOBJECTN(gcs[2], gcs2, "SR2_", GCS_MAVLINK), #endif +#if MAVLINK_COMM_NUM_BUFFERS > 3 + // @Group: SR3_ + // @Path: GCS_Mavlink.pde + GOBJECTN(gcs[3], gcs3, "SR3_", GCS_MAVLINK), +#endif + // @Group: INS_ // @Path: ../libraries/AP_InertialSensor/AP_InertialSensor.cpp GOBJECT(ins, "INS_", AP_InertialSensor), diff --git a/AntennaTracker/system.pde b/AntennaTracker/system.pde index caaac64c8e..c6dbca783f 100644 --- a/AntennaTracker/system.pde +++ b/AntennaTracker/system.pde @@ -46,6 +46,12 @@ static void init_tracker() gcs[2].set_snoop(mavlink_snoop); #endif +#if MAVLINK_COMM_NUM_BUFFERS > 3 + // setup serial port for fourth telemetry port (not used by default) and start snooping for vehicle data + gcs[3].setup_uart(serial_manager, AP_SerialManager::SerialProtocol_MAVLink, 2); + gcs[3].set_snoop(mavlink_snoop); +#endif + mavlink_system.sysid = g.sysid_this_mav; if (g.compass_enabled==true) {