mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-23 06:47:35 +08:00
logger: remove redundant format_len from message_format_s
This commit is contained in:
@@ -303,7 +303,6 @@ struct message_format_s {
|
||||
uint8_t msg_type = static_cast<uint8_t>(MessageType::FORMAT);
|
||||
|
||||
uint8_t msg_id;
|
||||
uint16_t format_len;
|
||||
char format[2096];
|
||||
};
|
||||
|
||||
@@ -894,8 +893,8 @@ void Logger::write_formats()
|
||||
|
||||
for (LoggerSubscription &sub : _subscriptions) {
|
||||
msg.msg_id = msg_id;
|
||||
msg.format_len = snprintf(msg.format, sizeof(msg.format), "%s", sub.metadata->o_fields);
|
||||
size_t msg_size = sizeof(msg) - sizeof(msg.format) + msg.format_len;
|
||||
int format_len = snprintf(msg.format, sizeof(msg.format), "%s", sub.metadata->o_fields);
|
||||
size_t msg_size = sizeof(msg) - sizeof(msg.format) + format_len;
|
||||
msg.msg_size = msg_size - 3;
|
||||
|
||||
write_wait(&msg, msg_size);
|
||||
|
||||
Reference in New Issue
Block a user