-static uint16_t getFDXchksum (uint64_t raw){
- uint8_t arr[8];
- num_to_bytes(raw, 64, arr);
- return crc16_ccitt_kermit(arr, 8);
-}
-
int getFDXBits(uint64_t national_id, uint16_t country, uint8_t isanimal, uint8_t isextended, uint32_t extended, uint8_t *bits) {
// add preamble ten 0x00 and one 0x01
int getFDXBits(uint64_t national_id, uint16_t country, uint8_t isanimal, uint8_t isextended, uint32_t extended, uint8_t *bits) {
// add preamble ten 0x00 and one 0x01
for (uint8_t i=0; i<8; ++i)
raw[i] = bytebits_to_byte(bits + 11 + i * 9, 8);
for (uint8_t i=0; i<8; ++i)
raw[i] = bytebits_to_byte(bits + 11 + i * 9, 8);
num_to_bytebitsLSBF(crc >> 0, 8, bits+83);
num_to_bytebitsLSBF(crc >> 8, 8, bits+92);
num_to_bytebitsLSBF(crc >> 0, 8, bits+83);
num_to_bytebitsLSBF(crc >> 8, 8, bits+92);
uint16_t calcCrc = crc16_ccitt_kermit(raw, 8);
PrintAndLog("\nFDX-B / ISO 11784/5 Animal Tag ID Found: Raw : %s", sprint_hex(raw, 8));
uint16_t calcCrc = crc16_ccitt_kermit(raw, 8);
PrintAndLog("\nFDX-B / ISO 11784/5 Animal Tag ID Found: Raw : %s", sprint_hex(raw, 8));
- PrintAndLog("Animal ID %04u-%012llu", countryCode, NationalCode);
- PrintAndLog("National Code %012llu (0x%llX)", NationalCode, NationalCode);
+ PrintAndLog("Animal ID %04u-%012" PRIu64, countryCode, NationalCode);
+ PrintAndLog("National Code %012" PRIu64 " (0x%" PRIx64 ")", NationalCode, NationalCode);
PrintAndLog("Country Code %04u", countryCode);
PrintAndLog("Reserved/RFU %u (0x04%X)", reservedCode, reservedCode);
PrintAndLog("");
PrintAndLog("Country Code %04u", countryCode);
PrintAndLog("Reserved/RFU %u (0x04%X)", reservedCode, reservedCode);
PrintAndLog("");
- uint32_t blocks[5] = {T55x7_MODULATION_DIPHASE | T55x7_BITRATE_RF_32 | 4<<T55x7_MAXBLOCK_SHIFT, 0, 0, 0, 0};
+ uint32_t blocks[5] = {T55x7_MODULATION_DIPHASE | T55x7_BITRATE_RF_32 | 4 << T55x7_MAXBLOCK_SHIFT, 0, 0, 0, 0};
animalid = param_get64ex(Cmd, 1, 0, 10);
//Q5
animalid = param_get64ex(Cmd, 1, 0, 10);
//Q5