AP_Camera: image-stop-capture fix for instance

This commit is contained in:
Randy Mackay 2023-09-22 20:41:35 +09:00 committed by Andrew Tridgell
parent fb35d97abf
commit 999a3fe8d9
1 changed files with 4 additions and 1 deletions

View File

@ -358,12 +358,15 @@ MAV_RESULT AP_Camera::handle_command_long(const mavlink_command_long_t &packet)
}
case MAV_CMD_IMAGE_STOP_CAPTURE:
// param1 : camera id
if (is_negative(packet.param1)) {
return MAV_RESULT_UNSUPPORTED;
}
if (is_zero(packet.param1)) {
// stop capture for every backend
stop_capture();
return MAV_RESULT_ACCEPTED;
}
if (stop_capture(packet.param1)) {
if (stop_capture(packet.param1-1)) {
return MAV_RESULT_ACCEPTED;
}
return MAV_RESULT_UNSUPPORTED;