mavlink: take in @dakejahl 's refactoring and extend it

This commit is contained in:
Jacob Dahl
2025-10-14 00:15:04 -08:00
committed by Matthias Grob
parent 65c5bd6906
commit d30fa62f40
3 changed files with 31 additions and 66 deletions
+3 -3
View File
@@ -187,7 +187,7 @@ Mavlink::mavlink_update_parameters()
{
updateParams();
set_protocol_version(_param_mav_proto_ver.get());
setProtocolVersion(_param_mav_proto_ver.get());
if (_param_mav_type.get() < 0 || _param_mav_type.get() >= MAV_TYPE_ENUM_END) {
_param_mav_type.set(0);
@@ -272,7 +272,7 @@ Mavlink::set_instance_id()
return false;
}
void Mavlink::set_protocol_version(unsigned version)
void Mavlink::setProtocolVersion(uint8_t version)
{
if (version == 1) {
get_status()->flags |= MAVLINK_STATUS_FLAG_OUT_MAVLINK1;
@@ -3041,7 +3041,7 @@ Mavlink::display_status()
}
printf("\tForwarding: %s\n", get_forwarding_on() ? "On" : "Off");
printf("\tMAVLink version: %" PRId32 "\n", _protocol_version);
printf("\tMAVLink version: %" PRId8 "\n", _protocol_version);
printf("\ttransport protocol: ");