MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / decodeDataRecord

Method decodeDataRecord

arch/victor9k/decoder.cc:95–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93 }
94
95 void decodeDataRecord() override
96 {
97 /* Check the ID. */
98
99 if (readRaw32() != VICTOR9K_DATA_RECORD)
100 return;
101
102 /* Read data. */
103
104 auto bytes = decode(readRawBits((VICTOR9K_SECTOR_LENGTH + 4) * 10))
105 .slice(0, VICTOR9K_SECTOR_LENGTH + 4);
106 ByteReader br(bytes);
107
108 _sector->data = br.read(VICTOR9K_SECTOR_LENGTH);
109 uint16_t gotChecksum = sumBytes(_sector->data);
110 uint16_t wantChecksum = br.read_le16();
111 _sector->status =
112 (gotChecksum == wantChecksum) ? Sector::OK : Sector::BAD_CHECKSUM;
113 }
114};
115
116std::unique_ptr<Decoder> createVictor9kDecoder(const DecoderProto& config)

Callers

nothing calls this directly

Calls 5

sumBytesFunction · 0.85
sliceMethod · 0.80
read_le16Method · 0.80
decodeFunction · 0.70
readMethod · 0.45

Tested by

no test coverage detected