diff --git a/libraries/AP_Camera/AP_Camera.cpp b/libraries/AP_Camera/AP_Camera.cpp index 4d25e91eea..9ff451603f 100644 --- a/libraries/AP_Camera/AP_Camera.cpp +++ b/libraries/AP_Camera/AP_Camera.cpp @@ -198,10 +198,10 @@ AP_Camera::trigger_pic_cleanup() /// decode deprecated MavLink message that controls camera. void -AP_Camera::control_msg(const mavlink_message_t* msg) +AP_Camera::control_msg(const mavlink_message_t &msg) { __mavlink_digicam_control_t packet; - mavlink_msg_digicam_control_decode(msg, &packet); + mavlink_msg_digicam_control_decode(&msg, &packet); control(packet.session, packet.zoom_pos, packet.zoom_step, packet.focus_lock, packet.shot, packet.command_id); } @@ -228,7 +228,7 @@ void AP_Camera::configure(float shooting_mode, float shutter_speed, float apertu mavlink_msg_command_long_encode(0, 0, &msg, &mav_cmd_long); // send to all components - GCS_MAVLINK::send_to_components(&msg); + GCS_MAVLINK::send_to_components(msg); if (_type == AP_Camera::CAMERA_TYPE_BMMCC) { // Set a trigger for the additional functions that are flip controlled (so far just ISO and Record Start / Stop use this method, will add others if required) @@ -277,7 +277,7 @@ void AP_Camera::control(float session, float zoom_pos, float zoom_step, float fo mavlink_msg_command_long_encode(0, 0, &msg, &mav_cmd_long); // send to all components - GCS_MAVLINK::send_to_components(&msg); + GCS_MAVLINK::send_to_components(msg); } /* @@ -440,7 +440,7 @@ void AP_Camera::take_picture() mavlink_msg_command_long_encode(0, 0, &msg, &cmd_msg); // forward to all components - GCS_MAVLINK::send_to_components(&msg); + GCS_MAVLINK::send_to_components(msg); } /* diff --git a/libraries/AP_Camera/AP_Camera.h b/libraries/AP_Camera/AP_Camera.h index 41a0e9e089..4f4baa350c 100644 --- a/libraries/AP_Camera/AP_Camera.h +++ b/libraries/AP_Camera/AP_Camera.h @@ -41,7 +41,7 @@ public: } // MAVLink methods - void control_msg(const mavlink_message_t* msg); + void control_msg(const mavlink_message_t &msg); void send_feedback(mavlink_channel_t chan); // Command processing