From a5bd65b923a253919cf768a2aaad77f13fd11e4c Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Thu, 7 Apr 2022 14:27:33 +1200 Subject: [PATCH] mavlink: set correct param capability PX4 supports int32 parameter types by interpreting the 32 bits in the float field as an int32 field. To signal this behaviour, it should set the bit which is described as PARAM_ENCODE_BYTEWISE. PX4 had always handled parameters this way but never actually sent the capability (which back then was called PARAM_UNION), however, it should have. This came up recently in the MAVLink devcall when these flags were discussed. The takeaway was to remove the flags to make it clearer and to make sure the projects (like PX4) send them out correctly. --- src/modules/mavlink/mavlink_main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/mavlink/mavlink_main.cpp b/src/modules/mavlink/mavlink_main.cpp index b72e566fed..d6ee7dd7a4 100644 --- a/src/modules/mavlink/mavlink_main.cpp +++ b/src/modules/mavlink/mavlink_main.cpp @@ -1056,6 +1056,7 @@ Mavlink::send_autopilot_capabilities() msg.capabilities |= MAV_PROTOCOL_CAPABILITY_MISSION_INT; msg.capabilities |= MAV_PROTOCOL_CAPABILITY_PARAM_FLOAT; msg.capabilities |= MAV_PROTOCOL_CAPABILITY_COMMAND_INT; + msg.capabilities |= MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE; msg.capabilities |= MAV_PROTOCOL_CAPABILITY_FTP; msg.capabilities |= MAV_PROTOCOL_CAPABILITY_SET_ATTITUDE_TARGET; msg.capabilities |= MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_LOCAL_NED;