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

Method decodeDataRecord

arch/tartu/decoder.cc:59–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57 }
58
59 void decodeDataRecord() override
60 {
61 if (readRaw64() != DATA_BITS)
62 return;
63
64 const auto& bits = readRawBits(129 * 16);
65 const auto& bytes = decodeFmMfm(bits).slice(0, 129);
66 _sector->data = bytes.slice(0, 128);
67
68 uint8_t wantChecksum = bytes.reader().seek(128).read_8();
69 uint8_t gotChecksum = ~sumBytes(_sector->data);
70 _sector->status =
71 (wantChecksum == gotChecksum) ? Sector::OK : Sector::BAD_CHECKSUM;
72 }
73
74private:
75 const TartuDecoderProto& _config;

Callers

nothing calls this directly

Calls 6

sumBytesFunction · 0.85
sliceMethod · 0.80
read_8Method · 0.80
readerMethod · 0.80
decodeFmMfmFunction · 0.50
seekMethod · 0.45

Tested by

no test coverage detected