diff --git a/communication/packet/wivicommandpacket.cpp b/communication/packet/wivicommandpacket.cpp index 091e150..b9cc899 100644 --- a/communication/packet/wivicommandpacket.cpp +++ b/communication/packet/wivicommandpacket.cpp @@ -15,9 +15,6 @@ std::shared_ptr WiVI::CommandPacket::DecodeToMessage(cons if(bytestream.size() < sizeof(WiVI::CommandPacket::Result)) return {}; - if(bytestream.size() != sizeof(WiVI::CommandPacket::Header) + header.length) - return {}; - const auto& decoded = *reinterpret_cast(bytestream.data()); msg->responseTo = decoded.responseTo; msg->success = decoded.result != 0; @@ -28,9 +25,6 @@ std::shared_ptr WiVI::CommandPacket::DecodeToMessage(cons if(bytestream.size() < sizeof(WiVI::CommandPacket::SetSignal)) return {}; - if(bytestream.size() != sizeof(WiVI::CommandPacket::SetSignal) + header.length) - return {}; - const auto& setSignal = *reinterpret_cast(bytestream.data()); msg->responseTo = WiVI::Command::GetSignal; msg->value = setSignal.value.ValueInt32; @@ -40,9 +34,6 @@ std::shared_ptr WiVI::CommandPacket::DecodeToMessage(cons if(bytestream.size() < sizeof(WiVI::CommandPacket::GetAll)) return {}; - if(bytestream.size() != sizeof(WiVI::CommandPacket::GetAll) + header.length) - return {}; - const auto& getAll = *reinterpret_cast(bytestream.data()); msg->responseTo = WiVI::Command::GetAll; msg->info.emplace();