| 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 | |
| 98 | std::unique_ptr<Decoder> createTids990Decoder(const DecoderProto& config) |
nothing calls this directly
no test coverage detected