Skip to content

Commit

Permalink
GCS_MAVLink: Add conditions and delete the same processing
Browse files Browse the repository at this point in the history
  • Loading branch information
muramura committed Sep 17, 2024
1 parent 86f51ee commit 32c5288
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions libraries/GCS_MAVLink/GCS_Common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3212,17 +3212,12 @@ MAV_RESULT GCS_MAVLINK::handle_command_get_message_interval(const mavlink_comman
}

uint16_t interval_ms = 0;
if (!get_ap_message_interval(id, interval_ms)) {
if (!get_ap_message_interval(id, interval_ms) || interval_ms == 0) {
// not streaming this message at the moment...
mavlink_msg_message_interval_send(chan, mavlink_id, -1); // disabled
return MAV_RESULT_ACCEPTED;
}

if (interval_ms == 0) {
mavlink_msg_message_interval_send(chan, mavlink_id, -1); // disabled
return MAV_RESULT_ACCEPTED;
}

mavlink_msg_message_interval_send(chan, mavlink_id, interval_ms * 1000);
return MAV_RESULT_ACCEPTED;
}
Expand Down

0 comments on commit 32c5288

Please sign in to comment.