mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
Rename timestampMultiplier to timestampResolution
We've also decided to leave it out of the message structures since, for most uses going forward, it will not be needed. Anyone who wants the timestamp resolution can always make the inexpensive device call to get it.
This commit is contained in:
@@ -25,10 +25,9 @@ bool Decoder::decode(std::shared_ptr<Message>& result, const std::shared_ptr<Pac
|
||||
if(!result)
|
||||
return false; // A nullptr was returned, the packet was not long enough to decode
|
||||
|
||||
// Timestamps are in (multiplier) ns increments since 1/1/2007 GMT 00:00:00.0000
|
||||
// The resolution (multiplier) depends on the device
|
||||
result->timestamp *= timestampMultiplier;
|
||||
result->timestampMultiplier = timestampMultiplier;
|
||||
// Timestamps are in (resolution) ns increments since 1/1/2007 GMT 00:00:00.0000
|
||||
// The resolution depends on the device
|
||||
result->timestamp *= timestampResolution;
|
||||
result->network = packet->network;
|
||||
return true;
|
||||
case Network::Type::CAN:
|
||||
@@ -41,10 +40,9 @@ bool Decoder::decode(std::shared_ptr<Message>& result, const std::shared_ptr<Pac
|
||||
if(!result)
|
||||
return false; // A nullptr was returned, the packet was malformed
|
||||
|
||||
// Timestamps are in (multiplier) ns increments since 1/1/2007 GMT 00:00:00.0000
|
||||
// The resolution (multiplier) depends on the device
|
||||
result->timestamp *= timestampMultiplier;
|
||||
result->timestampMultiplier = timestampMultiplier;
|
||||
// Timestamps are in (resolution) ns increments since 1/1/2007 GMT 00:00:00.0000
|
||||
// The resolution depends on the device
|
||||
result->timestamp *= timestampResolution;
|
||||
result->network = packet->network;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ neomessage_t icsneo::CreateNeoMessage(const std::shared_ptr<Message> message) {
|
||||
neomsg.length = message->data.size();
|
||||
neomsg.data = message->data.data();
|
||||
neomsg.timestamp = message->timestamp;
|
||||
neomsg.timestampMultiplier = message->timestampMultiplier;
|
||||
neomsg.status.globalError = message->error;
|
||||
neomsg.status.transmitMessage = message->transmitted;
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@ std::shared_ptr<CANMessage> HardwareCANPacket::DecodeToMessage(const std::vector
|
||||
msg->arbid = data->header.SID;
|
||||
}
|
||||
|
||||
// This timestamp is raw off the device (in timestampMultiplier increments)
|
||||
// Decoder will fix as it has information about the timestampMultiplier increments
|
||||
// This timestamp is raw off the device (in timestampResolution increments)
|
||||
// Decoder will fix as it has information about the timestampResolution increments
|
||||
msg->timestamp = data->timestamp.TS;
|
||||
|
||||
// DLC
|
||||
|
||||
@@ -40,8 +40,8 @@ std::shared_ptr<EthernetMessage> HardwareEthernetPacket::DecodeToMessage(const s
|
||||
if(message.frameTooShort)
|
||||
message.error = true;
|
||||
|
||||
// This timestamp is raw off the device (in timestampMultiplier increments)
|
||||
// Decoder will fix as it has information about the timestampMultiplier increments
|
||||
// This timestamp is raw off the device (in timestampResolution increments)
|
||||
// Decoder will fix as it has information about the timestampResolution increments
|
||||
message.timestamp = packet->timestamp.TS;
|
||||
|
||||
// Network ID is also not set, this will be fixed in the Decoder as well
|
||||
|
||||
Reference in New Issue
Block a user