mavlink:Use inttypes

This commit is contained in:
David Sidrane
2021-04-22 10:00:12 -07:00
committed by Julian Oes
parent 5faa116681
commit 65d026d45c
5 changed files with 61 additions and 55 deletions
+17 -13
View File
@@ -562,7 +562,7 @@ void MavlinkReceiver::handle_message_command_both(mavlink_message_t *msg, const
send_ack = false;
if (msg->sysid == mavlink_system.sysid && msg->compid == mavlink_system.compid) {
PX4_WARN("ignoring CMD with same SYS/COMP (%d/%d) ID", mavlink_system.sysid, mavlink_system.compid);
PX4_WARN("ignoring CMD with same SYS/COMP (%" PRIu8 "/%" PRIu8 ") ID", mavlink_system.sysid, mavlink_system.compid);
return;
}
@@ -656,7 +656,7 @@ MavlinkReceiver::handle_message_command_ack(mavlink_message_t *msg)
// TODO: move it to the same place that sent the command
if (ack.result != MAV_RESULT_ACCEPTED && ack.result != MAV_RESULT_IN_PROGRESS) {
if (msg->compid == MAV_COMP_ID_CAMERA) {
PX4_WARN("Got unsuccessful result %d from camera", ack.result);
PX4_WARN("Got unsuccessful result %" PRIu8 " from camera", ack.result);
}
}
}
@@ -946,7 +946,7 @@ MavlinkReceiver::handle_message_set_position_target_local_ned(mavlink_message_t
setpoint.z = NAN;
} else {
mavlink_log_critical(&_mavlink_log_pub, "SET_POSITION_TARGET_LOCAL_NED coordinate frame %d unsupported",
mavlink_log_critical(&_mavlink_log_pub, "SET_POSITION_TARGET_LOCAL_NED coordinate frame %" PRIu8 " unsupported",
target_local_ned.coordinate_frame);
return;
}
@@ -1054,7 +1054,7 @@ MavlinkReceiver::handle_message_set_position_target_global_int(mavlink_message_t
}
} else {
mavlink_log_critical(&_mavlink_log_pub, "SET_POSITION_TARGET_GLOBAL_INT invalid coordinate frame %d",
mavlink_log_critical(&_mavlink_log_pub, "SET_POSITION_TARGET_GLOBAL_INT invalid coordinate frame %" PRIu8,
target_global_int.coordinate_frame);
return;
}
@@ -1299,7 +1299,7 @@ MavlinkReceiver::handle_message_odometry(mavlink_message_t *msg)
}
} else {
PX4_ERR("Body frame %u not supported. Unable to publish velocity", odom.child_frame_id);
PX4_ERR("Body frame %" PRIu8 " not supported. Unable to publish velocity", odom.child_frame_id);
}
/**
@@ -1330,11 +1330,11 @@ MavlinkReceiver::handle_message_odometry(mavlink_message_t *msg)
_mocap_odometry_pub.publish(odometry);
} else {
PX4_ERR("Estimator source %u not supported. Unable to publish pose and velocity", odom.estimator_type);
PX4_ERR("Estimator source %" PRIu8 " not supported. Unable to publish pose and velocity", odom.estimator_type);
}
} else {
PX4_ERR("Local frame %u not supported. Unable to publish pose and velocity", odom.frame_id);
PX4_ERR("Local frame %" PRIu8 " not supported. Unable to publish pose and velocity", odom.frame_id);
}
}
@@ -1690,7 +1690,7 @@ MavlinkReceiver::handle_message_play_tune_v2(mavlink_message_t *msg)
(mavlink_system.compid == play_tune_v2.target_component || play_tune_v2.target_component == 0)) {
if (play_tune_v2.format != TUNE_FORMAT_QBASIC1_1) {
PX4_ERR("Tune format %d not supported", play_tune_v2.format);
PX4_ERR("Tune format %" PRIu32 " not supported", play_tune_v2.format);
return;
}
@@ -2016,7 +2016,8 @@ MavlinkReceiver::handle_message_heartbeat(mavlink_message_t *msg)
break;
default:
PX4_DEBUG("unhandled HEARTBEAT MAV_TYPE: %d from SYSID: %d, COMPID: %d", hb.type, msg->sysid, msg->compid);
PX4_DEBUG("unhandled HEARTBEAT MAV_TYPE: %" PRIu8 " from SYSID: %" PRIu8 ", COMPID: %" PRIu8, hb.type, msg->sysid,
msg->compid);
}
@@ -2055,7 +2056,8 @@ MavlinkReceiver::handle_message_heartbeat(mavlink_message_t *msg)
break;
default:
PX4_DEBUG("unhandled HEARTBEAT MAV_TYPE: %d from SYSID: %d, COMPID: %d", hb.type, msg->sysid, msg->compid);
PX4_DEBUG("unhandled HEARTBEAT MAV_TYPE: %" PRIu8 " from SYSID: %" PRIu8 ", COMPID: %" PRIu8, hb.type, msg->sysid,
msg->compid);
}
CheckHeartbeats(now, true);
@@ -2313,7 +2315,7 @@ MavlinkReceiver::handle_message_landing_target(mavlink_message_t *msg)
} else if (landing_target.position_valid) {
// We only support MAV_FRAME_LOCAL_NED. In this case, the frame was unsupported.
mavlink_log_critical(&_mavlink_log_pub, "landing target: coordinate frame %d unsupported",
mavlink_log_critical(&_mavlink_log_pub, "landing target: coordinate frame %" PRIu8 " unsupported",
landing_target.frame);
} else {
@@ -2792,7 +2794,8 @@ void MavlinkReceiver::handle_message_statustext(mavlink_message_t *msg)
log_message.timestamp = hrt_absolute_time();
snprintf(log_message.text, sizeof(log_message.text),
"[mavlink: component %d] %." STRINGIFY(MAVLINK_MSG_STATUSTEXT_FIELD_TEXT_LEN) "s", msg->compid, statustext.text);
"[mavlink: component %" PRIu8 "] %." STRINGIFY(MAVLINK_MSG_STATUSTEXT_FIELD_TEXT_LEN) "s", msg->compid,
statustext.text);
_log_message_pub.publish(log_message);
}
@@ -3190,7 +3193,8 @@ void MavlinkReceiver::print_detailed_rx_stats() const
// TODO: add mutex around shared data.
for (unsigned i = 0; i < MAX_REMOTE_COMPONENTS; ++i) {
if (_component_states[i].received_messages > 0) {
printf("\t received from sysid: %u compid: %u: %u, lost: %u, last %u ms ago\n",
printf("\t received from sysid: %" PRIu8 " compid: %" PRIu8 ": %" PRIu32 ", lost: %" PRIu32 ", last %" PRIu32
" ms ago\n",
_component_states[i].system_id,
_component_states[i].component_id,
_component_states[i].received_messages,