Decoder: Pass on short Device messages

pull/35/head
Paul Hollinsky 2021-04-29 19:07:38 -04:00
parent 0ce52f064b
commit 3d4e0a27e3
1 changed files with 4 additions and 2 deletions

View File

@ -123,8 +123,10 @@ bool Decoder::decode(std::shared_ptr<Message>& result, const std::shared_ptr<Pac
// They come in as CAN but we will handle them in the device rather than // They come in as CAN but we will handle them in the device rather than
// passing them onto the user. // passing them onto the user.
if(packet->data.size() < 24) { if(packet->data.size() < 24) {
report(APIEvent::Type::PacketDecodingError, APIEvent::Severity::Error); result = std::make_shared<Message>();
return false; result->network = packet->network;
result->data = packet->data;
return true;
} }
result = HardwareCANPacket::DecodeToMessage(packet->data); result = HardwareCANPacket::DecodeToMessage(packet->data);