#include "icsneo/communication/packet/logicaldiskinfopacket.h" using namespace icsneo; std::shared_ptr LogicalDiskInfoPacket::DecodeToMessage(const std::vector& bytestream) { // Make sure we have enough to read the packet length first if(bytestream.size() < sizeof(LogicalDiskInfoPacket)) return {}; const LogicalDiskInfoPacket* packet = reinterpret_cast(bytestream.data()); return std::make_shared(packet->isConnected != 0, packet->numSectors, packet->hiddenSectors, packet->bytesPerSector); }