Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix version topic publish #650

Merged
merged 1 commit into from
Mar 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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.mfguid)));
memcpy(hwinfo.hw_info, hw_info, min(sizeof(hwinfo.hw_info), 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);
Expand Down
Loading