| 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 | |
| 108 | std::unique_ptr<Decoder> createDurangoF85Decoder(const DecoderProto& config) |