Skip to content

Commit

Permalink
DroneCan: use correct version number
Browse files Browse the repository at this point in the history
  • Loading branch information
meee1 committed Aug 15, 2024
1 parent 7d9cc9b commit ed6882f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ExtLibs/DroneCAN/DroneCAN.cs
Original file line number Diff line number Diff line change
Expand Up @@ -378,9 +378,11 @@ public void StartSLCAN(Stream stream, Baud baud = Baud.baud1mbit)
else if (frame.IsServiceMsg && msg.GetType() == typeof(DroneCAN.uavcan_protocol_GetNodeInfo_req) && frame.SvcDestinationNode == SourceNode)
{
var gnires = new DroneCAN.uavcan_protocol_GetNodeInfo_res();
gnires.software_version.major = (byte)Assembly.GetExecutingAssembly().GetName().Version.Major;
gnires.software_version.minor = (byte)Assembly.GetExecutingAssembly().GetName().Version.Minor;
gnires.hardware_version.major = 0;
var fvi = System.Diagnostics.FileVersionInfo.GetVersionInfo(Assembly.GetEntryAssembly().Location);
gnires.software_version.major = (byte)fvi.ProductMajorPart;
gnires.software_version.minor = (byte)fvi.ProductMinorPart;
gnires.software_version.vcs_commit = uint.Parse(fvi.ProductBuildPart.ToString(), NumberStyles.HexNumber);
gnires.hardware_version.major = (byte)0;
gnires.hardware_version.unique_id = ASCIIEncoding.ASCII.GetBytes(("MissionPlanner").PadRight(16, '\x0'));
gnires.name = ASCIIEncoding.ASCII.GetBytes("org.missionplanner");
gnires.name_len = (byte)gnires.name.Length;
Expand Down

0 comments on commit ed6882f

Please sign in to comment.