Decode route element float fields

This commit is contained in:
2026-06-20 13:53:09 -05:00
parent b34f2e2dee
commit eee31e55d8
2 changed files with 55 additions and 4 deletions
+13 -2
View File
@@ -450,6 +450,13 @@ void AppendHexValue(std::ostringstream& aLine, const char* aLabel, uint64_t aVal
aLine << " " << aLabel << "=0x" << std::hex << aValue << std::dec;
}
float FloatFromBits(uint32_t aBits)
{
float value = 0.0f;
std::memcpy(&value, &aBits, sizeof(value));
return value;
}
void LogHookCall(const char* aName, uint32_t aCount, void* aThis, void* a2, void* a3, void* a4)
{
std::ostringstream line;
@@ -947,8 +954,12 @@ void AppendGpsResultElementArraySummary(std::ostringstream& aLine, const char* a
continue;
}
aLine << std::hex << h00 << "," << std::dec << u08 << "," << u0c << "," << u10 << "," << u14 << ","
<< std::hex << h18 << "," << h20 << std::dec;
const auto h18Lo = static_cast<uint32_t>(h18);
const auto h18Hi = static_cast<uint32_t>(h18 >> 32);
aLine << std::hex << h00 << ",0x" << std::setw(8) << std::setfill('0') << u08 << std::setfill(fill)
<< std::dec << "," << u0c << "," << u10 << "," << u14 << "," << std::hex << h18 << std::dec
<< "," << FloatFromBits(h18Lo) << "," << FloatFromBits(h18Hi) << "," << std::hex << h20
<< std::dec;
}
aLine << "]";
aLine.flags(flags);