From 30a3927ea8f44d49d90490307eedbd4f95cbabe9 Mon Sep 17 00:00:00 2001 From: Michael Oborne Date: Wed, 18 Jun 2014 12:03:18 +1000 Subject: [PATCH] AP_Mount: fix where status_msg() is sent send to the channel where the trigger msg was sent from --- libraries/AP_Mount/AP_Mount.cpp | 6 ++---- libraries/AP_Mount/AP_Mount.h | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/libraries/AP_Mount/AP_Mount.cpp b/libraries/AP_Mount/AP_Mount.cpp index d534eb332f..5f30de0fda 100644 --- a/libraries/AP_Mount/AP_Mount.cpp +++ b/libraries/AP_Mount/AP_Mount.cpp @@ -494,7 +494,7 @@ void AP_Mount::control_msg(mavlink_message_t *msg) /// Return mount status information (depends on the previously set mount configuration) /// triggered by a MavLink packet. -void AP_Mount::status_msg(mavlink_message_t *msg) +void AP_Mount::status_msg(mavlink_message_t *msg, mavlink_channel_t chan) { __mavlink_mount_status_t packet; mavlink_msg_mount_status_decode(msg, &packet); @@ -524,9 +524,7 @@ void AP_Mount::status_msg(mavlink_message_t *msg) break; } - // status reply - // TODO: is COMM_3 correct ? - mavlink_msg_mount_status_send(MAVLINK_COMM_3, packet.target_system, packet.target_component, + mavlink_msg_mount_status_send_buf(msg, chan, packet.target_system, packet.target_component, packet.pointing_a, packet.pointing_b, packet.pointing_c); } diff --git a/libraries/AP_Mount/AP_Mount.h b/libraries/AP_Mount/AP_Mount.h index 43835ca4b1..1ea8da1041 100644 --- a/libraries/AP_Mount/AP_Mount.h +++ b/libraries/AP_Mount/AP_Mount.h @@ -52,7 +52,7 @@ public: // MAVLink methods void configure_msg(mavlink_message_t* msg); void control_msg(mavlink_message_t* msg); - void status_msg(mavlink_message_t* msg); + void status_msg(mavlink_message_t* msg, mavlink_channel_t chan); void set_roi_cmd(const struct Location *target_loc); void configure_cmd(); void control_cmd();