mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-13 18:23:34 +08:00
Refactored uavcan.protocol.SoftwareVersion
This commit is contained in:
@@ -3,6 +3,17 @@
|
||||
# Generic software version information.
|
||||
#
|
||||
|
||||
# Primary version numbers for humans. Can be both set to zeros if not available.
|
||||
uint8 major
|
||||
uint8 minor
|
||||
uint32 build # VCS revision hash, build date, etc
|
||||
|
||||
# This mask indicates which optional fields are set.
|
||||
uint8 OPTIONAL_FIELD_MASK_VCS_COMMIT = 1
|
||||
uint8 OPTIONAL_FIELD_MASK_IMAGE_CRC = 2
|
||||
uint8 optional_field_mask
|
||||
|
||||
# VCS commit hash or revision number, e.g. git short commit hash. Useful for the developers. Optional.
|
||||
uint32 vcs_commit
|
||||
|
||||
# CRC-64-WE of the firmware image. CRC function is the same as in the data type signature. Optional.
|
||||
uint64 image_crc
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
|
||||
/**
|
||||
* UAVCAN version definition
|
||||
* // TODO: Use git short hash as build id
|
||||
*/
|
||||
#define UAVCAN_VERSION_MAJOR 0
|
||||
#define UAVCAN_VERSION_MINOR 1
|
||||
|
||||
@@ -62,7 +62,9 @@ TEST(Dsdl, Streaming)
|
||||
"software_version: \n"
|
||||
" major: 0\n"
|
||||
" minor: 0\n"
|
||||
" build: 0\n"
|
||||
" optional_field_mask: 0\n"
|
||||
" vcs_commit: 0\n"
|
||||
" image_crc: 0\n"
|
||||
"status: \n"
|
||||
" uptime_sec: 0\n"
|
||||
" status_code: 0\n"
|
||||
|
||||
@@ -30,7 +30,7 @@ TEST(Node, Basic)
|
||||
uavcan::protocol::SoftwareVersion swver;
|
||||
swver.major = 0;
|
||||
swver.minor = 1;
|
||||
swver.build = 0xDEADBEEF;
|
||||
swver.vcs_commit = 0xDEADBEEF;
|
||||
|
||||
/*
|
||||
* uavcan::Node
|
||||
|
||||
@@ -33,7 +33,7 @@ struct NetworkCompatibilityCheckerRemoteContext
|
||||
{
|
||||
node_status_provider.setName("com.example");
|
||||
uavcan::protocol::SoftwareVersion swver;
|
||||
swver.build = 1;
|
||||
swver.vcs_commit = 1;
|
||||
node_status_provider.setSoftwareVersion(swver);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ TEST(NodeStatusProvider, Basic)
|
||||
uavcan::protocol::SoftwareVersion swver;
|
||||
swver.major = 2;
|
||||
swver.minor = 18;
|
||||
swver.build = 0x600DF00D;
|
||||
swver.vcs_commit = 0x600DF00D;
|
||||
|
||||
nsp.setHardwareVersion(hwver);
|
||||
nsp.setSoftwareVersion(swver);
|
||||
|
||||
Reference in New Issue
Block a user