Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions src/Camera/VehicleCameraControl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,17 @@ MavlinkCameraControlInterface::CapturePhotosState VehicleCameraControl::captureP

QString VehicleCameraControl::firmwareVersion() const
{
int major = (_mavlinkCameraInfo.firmware_version >> 24) & 0xFF;
int minor = (_mavlinkCameraInfo.firmware_version >> 16) & 0xFF;
int build = _mavlinkCameraInfo.firmware_version & 0xFFFF;
return QString::asprintf("%d.%d.%d", major, minor, build);
if (_mavlinkCameraInfo.firmware_version == 0) {
return {};
}
Comment on lines +263 to +265
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description checklist indicates tests were added/updated, but this change set only updates production code. Either add a corresponding test (likely under test/Camera/VehicleCameraControlTest.cc) or update the PR checklist to reflect what was actually done.

Copilot uses AI. Check for mistakes.
int major = (_mavlinkCameraInfo.firmware_version) & 0xFF;
int minor = (_mavlinkCameraInfo.firmware_version >> 8) & 0xFF;
int patch = (_mavlinkCameraInfo.firmware_version >> 16) & 0xFF;
int dev = (_mavlinkCameraInfo.firmware_version >> 24) & 0xFF;
if (dev != 0) {
Comment on lines +266 to +270
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new MAVLink-spec firmware_version decoding logic should be covered by a unit test (e.g., cases for 0 -> empty/unknown, dev==0 -> "major.minor.patch", dev!=0 -> "major.minor.patch.dev") so regressions don’t silently reintroduce the byte-order issue.

Copilot uses AI. Check for mistakes.
return QString::asprintf("%d.%d.%d.%d", major, minor, patch, dev);
}
return QString::asprintf("%d.%d.%d", major, minor, patch);
}

QString VehicleCameraControl::recordTimeStr() const
Expand Down
Loading