mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
logger: use int32_t for utc_offset instead of uint32_t
This commit is contained in:
parent
623fe7ca2c
commit
bd96afa00b
@ -912,7 +912,7 @@ void Logger::write_info(const char *name, const char *value)
|
||||
|
||||
_writer.unlock();
|
||||
}
|
||||
void Logger::write_info(const char *name, uint32_t value)
|
||||
void Logger::write_info(const char *name, int32_t value)
|
||||
{
|
||||
_writer.lock();
|
||||
uint8_t buffer[sizeof(message_info_header_s)];
|
||||
@ -920,12 +920,12 @@ void Logger::write_info(const char *name, uint32_t value)
|
||||
msg->msg_type = static_cast<uint8_t>(MessageType::INFO);
|
||||
|
||||
/* construct format key (type and name) */
|
||||
msg->key_len = snprintf(msg->key, sizeof(msg->key), "uint32_t %s", name);
|
||||
msg->key_len = snprintf(msg->key, sizeof(msg->key), "int32_t %s", name);
|
||||
size_t msg_size = sizeof(*msg) - sizeof(msg->key) + msg->key_len;
|
||||
|
||||
/* copy string value directly to buffer */
|
||||
memcpy(&buffer[msg_size], &value, sizeof(uint32_t));
|
||||
msg_size += sizeof(uint32_t);
|
||||
memcpy(&buffer[msg_size], &value, sizeof(int32_t));
|
||||
msg_size += sizeof(int32_t);
|
||||
|
||||
msg->msg_size = msg_size - MSG_HEADER_LEN;
|
||||
|
||||
|
||||
@ -150,7 +150,7 @@ private:
|
||||
void write_version();
|
||||
|
||||
void write_info(const char *name, const char *value);
|
||||
void write_info(const char *name, uint32_t value);
|
||||
void write_info(const char *name, int32_t value);
|
||||
|
||||
void write_parameters();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user