Skip to content

Commit

Permalink
GCS_MAVLink: Add handler for CAMERA_CAPTURE_STATUS request
Browse files Browse the repository at this point in the history
  • Loading branch information
nexton-winjeel committed Nov 8, 2023
1 parent 2e66347 commit cd7c20d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions libraries/GCS_MAVLink/GCS_Common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -999,6 +999,7 @@ ap_message GCS_MAVLINK::mavlink_id_to_ap_message_id(const uint32_t mavlink_id) c
{ MAVLINK_MSG_ID_CAMERA_INFORMATION, MSG_CAMERA_INFORMATION},
{ MAVLINK_MSG_ID_CAMERA_SETTINGS, MSG_CAMERA_SETTINGS},
{ MAVLINK_MSG_ID_CAMERA_FOV_STATUS, MSG_CAMERA_FOV_STATUS},
{ MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS, MSG_CAMERA_CAPTURE_STATUS},
#endif
#if HAL_MOUNT_ENABLED
{ MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS, MSG_GIMBAL_DEVICE_ATTITUDE_STATUS},
Expand Down Expand Up @@ -5785,6 +5786,16 @@ bool GCS_MAVLINK::try_send_message(const enum ap_message id)
}
break;
#endif
case MSG_CAMERA_CAPTURE_STATUS:
{
AP_Camera *camera = AP::camera();
if (camera == nullptr) {
break;
}
CHECK_PAYLOAD_SIZE(CAMERA_CAPTURE_STATUS);
camera->send_camera_capture_status(chan);
}
break;
#endif

case MSG_SYSTEM_TIME:
Expand Down
1 change: 1 addition & 0 deletions libraries/GCS_MAVLink/ap_message.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ enum ap_message : uint8_t {
MSG_CAMERA_INFORMATION,
MSG_CAMERA_SETTINGS,
MSG_CAMERA_FOV_STATUS,
MSG_CAMERA_CAPTURE_STATUS,
MSG_GIMBAL_DEVICE_ATTITUDE_STATUS,
MSG_GIMBAL_MANAGER_INFORMATION,
MSG_GIMBAL_MANAGER_STATUS,
Expand Down

0 comments on commit cd7c20d

Please sign in to comment.