From 6770743609608f0d720e2d953d7c21167e562754 Mon Sep 17 00:00:00 2001 From: Jukka Laitinen Date: Mon, 4 Mar 2024 10:40:12 +0200 Subject: [PATCH] Fix publishing guid and hwinfo topics and add timestamp to all version topics. Signed-off-by: Jukka Laitinen --- .../src/px4/microchip/mpfs/version/board_mcu_version.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/platforms/nuttx/src/px4/microchip/mpfs/version/board_mcu_version.c b/platforms/nuttx/src/px4/microchip/mpfs/version/board_mcu_version.c index a2fd4df5c5de..a4653c9af302 100644 --- a/platforms/nuttx/src/px4/microchip/mpfs/version/board_mcu_version.c +++ b/platforms/nuttx/src/px4/microchip/mpfs/version/board_mcu_version.c @@ -284,6 +284,7 @@ int board_determine_hw_info(void) orb_advert_t hw_info_pub = orb_advertise(ORB_ID(hw_info), NULL); uint32_t fpga_version = getreg32(FPGA_VER_REGISTER); // todo: replace eventually with device_boot_info + uint64_t timestamp = hrt_absolute_time(); memset(&ver_str, 0, sizeof(ver_str)); memset(&ver, 0, sizeof(ver)); @@ -329,11 +330,16 @@ int board_determine_hw_info(void) /* Make local copies of guid and hwinfo */ - memcpy(&guid, device_serial_number, min(sizeof(device_serial_number), sizeof(guid))); - memcpy(&hwinfo, hw_info, min(sizeof(hwinfo), sizeof(hw_info))); + memcpy(guid.mfguid, device_serial_number, min(sizeof(device_serial_number), sizeof(guid))); + memcpy(hwinfo.hw_info, hw_info, min(sizeof(hwinfo), sizeof(hw_info))); /* Then publish the topics */ + ver_str.timestamp = timestamp; + ver.timestamp = timestamp; + guid.timestamp = timestamp; + hwinfo.timestamp = timestamp; + orb_publish(ORB_ID(system_version_string), &ver_str_pub, &ver_str); orb_publish(ORB_ID(system_version), &ver_pub, &ver); orb_publish(ORB_ID(guid), &mfguid_pub, &guid);