20 #include <boost/crc.hpp>
27 namespace data_conversion_layer
35 std::ostringstream os;
37 const uint32_t reserved{ 0 };
39 boost::crc_32_type crc;
40 crc.process_bytes(&reserved,
sizeof(reserved));
41 crc.process_bytes(&op_code,
sizeof(op_code));
42 crc.process_bytes(&res_code,
sizeof(res_code));
49 const std::string data_str(os.str());
51 "Message data of start reply has not the expected size");
57 return serialize(
static_cast<uint32_t
>(reply.
type()),
static_cast<uint32_t
>(reply.
result()));
62 std::istringstream is(std::string(data.data(),
Message::SIZE));
74 boost::crc_32_type crc_checked;
75 crc_checked.process_bytes(&reserved,
sizeof(reserved));
76 crc_checked.process_bytes(&opcode,
sizeof(opcode));
77 crc_checked.process_bytes(&res_code,
sizeof(res_code));
79 if (crc != crc_checked.checksum())