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

Method decodeDataRecord

arch/tids990/decoder.cc:79–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77 }
78
79 void decodeDataRecord() override
80 {
81 auto bits = readRawBits(TIDS990_DATA_RECORD_SIZE * 16);
82 auto bytes = decodeFmMfm(bits).slice(0, TIDS990_DATA_RECORD_SIZE);
83
84 ByteReader br(bytes);
85 if (br.read_be16() != DATA_ID)
86 return;
87
88 uint16_t gotChecksum =
89 crc16(CCITT_POLY, bytes.slice(1, TIDS990_DATA_RECORD_SIZE - 3));
90
91 _sector->data = br.read(TIDS990_PAYLOAD_SIZE);
92 uint16_t wantChecksum = br.read_be16();
93 _sector->status =
94 (wantChecksum == gotChecksum) ? Sector::OK : Sector::BAD_CHECKSUM;
95 }
96};
97
98std::unique_ptr<Decoder> createTids990Decoder(const DecoderProto& config)

Callers

nothing calls this directly

Calls 5

sliceMethod · 0.80
read_be16Method · 0.80
decodeFmMfmFunction · 0.50
crc16Function · 0.50
readMethod · 0.45

Tested by

no test coverage detected