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

Method decodeDataRecord

arch/f85/decoder.cc:89–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87 }
88
89 void decodeDataRecord() override
90 {
91 /* Skip sync bits ID byte. */
92
93 if (readRaw24() != F85_DATA_RECORD)
94 return;
95
96 const auto& bytes = decode(readRawBits((F85_SECTOR_LENGTH + 3) * 10))
97 .slice(0, F85_SECTOR_LENGTH + 3);
98 ByteReader br(bytes);
99
100 _sector->data = br.read(F85_SECTOR_LENGTH);
101 uint16_t wantChecksum = br.read_be16();
102 uint16_t gotChecksum = crc16(CCITT_POLY, 0xbf84, _sector->data);
103 _sector->status =
104 (wantChecksum == gotChecksum) ? Sector::OK : Sector::BAD_CHECKSUM;
105 }
106};
107
108std::unique_ptr<Decoder> createDurangoF85Decoder(const DecoderProto& config)

Callers

nothing calls this directly

Calls 5

sliceMethod · 0.80
read_be16Method · 0.80
decodeFunction · 0.70
crc16Function · 0.50
readMethod · 0.45

Tested by

no test coverage detected