forked from Archive/PX4-Autopilot
Merge branch 'uavcan_node_info'
This commit is contained in:
commit
d3d5aa9bdc
|
@ -180,16 +180,13 @@ void UavcanNode::fill_node_info()
|
||||||
/* software version */
|
/* software version */
|
||||||
uavcan::protocol::SoftwareVersion swver;
|
uavcan::protocol::SoftwareVersion swver;
|
||||||
|
|
||||||
// Extracting the last 8 hex digits of FW_GIT and converting them to int
|
// Extracting the first 8 hex digits of FW_GIT and converting them to int
|
||||||
const unsigned fw_git_len = std::strlen(FW_GIT);
|
char fw_git_short[9] = {};
|
||||||
if (fw_git_len >= 8) {
|
std::memmove(fw_git_short, FW_GIT, 8);
|
||||||
char fw_git_short[9] = {};
|
assert(fw_git_short[8] == '\0');
|
||||||
std::memmove(fw_git_short, FW_GIT + fw_git_len - 8, 8);
|
char *end = nullptr;
|
||||||
assert(fw_git_short[8] == '\0');
|
swver.vcs_commit = std::strtol(fw_git_short, &end, 16);
|
||||||
char *end = nullptr;
|
swver.optional_field_mask |= swver.OPTIONAL_FIELD_MASK_VCS_COMMIT;
|
||||||
swver.vcs_commit = std::strtol(fw_git_short, &end, 16);
|
|
||||||
swver.optional_field_mask |= swver.OPTIONAL_FIELD_MASK_VCS_COMMIT;
|
|
||||||
}
|
|
||||||
|
|
||||||
warnx("SW version vcs_commit: 0x%08x", unsigned(swver.vcs_commit));
|
warnx("SW version vcs_commit: 0x%08x", unsigned(swver.vcs_commit));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue