Skip to content

Commit

Permalink
Don't use c++20 stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
DonLakeFlyer committed Aug 21, 2024
1 parent 7e581a1 commit e9b615f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 19 deletions.
11 changes: 5 additions & 6 deletions src/Camera/QGCCameraManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -400,12 +400,11 @@ static void _requestCameraInfoMessageResultHandler(void* resultHandlerData, MAV_
if (result != MAV_RESULT_ACCEPTED) {
qCDebug(CameraManagerLog) << "MAV_CMD_REQUEST_MESSAGE:MAVLINK_MSG_ID_CAMERA_INFORMATION failed. Falling back to MAV_CMD_REQUEST_CAMERA_INFORMATION. compId" << cameraInfo->compID << "Result:" << result << "FailureCode:" << failureCode;

Vehicle::MavCmdAckHandlerInfo_t ackHandlerInfo = {
.resultHandler = _requestCameraInfoCommandResultHandler,
.resultHandlerData = cameraInfo,
.progressHandler = nullptr,
.progressHandlerData = nullptr
};
Vehicle::MavCmdAckHandlerInfo_t ackHandlerInfo;
ackHandlerInfo.resultHandler = _requestCameraInfoCommandResultHandler;
ackHandlerInfo.resultHandlerData = cameraInfo;
ackHandlerInfo.progressHandler = nullptr;
ackHandlerInfo.progressHandlerData = nullptr;

cameraInfo->vehicle->sendMavCommandWithHandler(&ackHandlerInfo, cameraInfo->compID, MAV_CMD_REQUEST_CAMERA_INFORMATION, 1 /* request camera capabilities */);
}
Expand Down
25 changes: 12 additions & 13 deletions src/Vehicle/Vehicle.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2855,19 +2855,18 @@ void Vehicle::_requestMessageWaitForMessageResultHandler(void* resultHandlerData

void Vehicle::requestMessage(RequestMessageResultHandler resultHandler, void* resultHandlerData, int compId, int messageId, float param1, float param2, float param3, float param4, float param5)
{
RequestMessageInfo_t requestInfo = {
.vehicle = this,
.compId = compId,
.msgId = messageId,
.resultHandler = resultHandler,
.resultHandlerData = resultHandlerData,
};
_requestMessageInfoMap[compId][messageId] = new RequestMessageInfo_t(requestInfo);

Vehicle::MavCmdAckHandlerInfo_t handlerInfo = {
.resultHandler = _requestMessageCmdResultHandler,
.resultHandlerData = &requestInfo,
};
auto requestMessageInfo = new RequestMessageInfo_t;
requestMessageInfo->vehicle = this;
requestMessageInfo->compId = compId;
requestMessageInfo->msgId = messageId;
requestMessageInfo->resultHandler = resultHandler;
requestMessageInfo->resultHandlerData = resultHandlerData;

_requestMessageInfoMap[compId][messageId] = requestMessageInfo;

Vehicle::MavCmdAckHandlerInfo_t handlerInfo;
handlerInfo.resultHandler = _requestMessageCmdResultHandler;
handlerInfo.resultHandlerData = requestMessageInfo;

_sendMavCommandWorker(false, // commandInt
false, // showError
Expand Down

0 comments on commit e9b615f

Please sign in to comment.