From fb46e326c4ea82dc04e5210b0fcf0fdb02e4bb85 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Mon, 12 Oct 2020 00:20:51 +0200 Subject: [PATCH] fdxb: shows new ISO amendment fields --- client/src/cmdlffdxb.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/client/src/cmdlffdxb.c b/client/src/cmdlffdxb.c index 342797503..65b2efd6e 100644 --- a/client/src/cmdlffdxb.c +++ b/client/src/cmdlffdxb.c @@ -253,18 +253,34 @@ int demodFDXB(bool verbose) { //got a good demod uint8_t offset; + // ISO: bits 27..64 uint64_t NationalCode = ((uint64_t)(bytebits_to_byteLSBF(DemodBuffer + 32, 6)) << 32) | bytebits_to_byteLSBF(DemodBuffer, 32); offset = 38; + // ISO: bits 17..26 uint16_t countryCode = bytebits_to_byteLSBF(DemodBuffer + offset, 10); offset += 10; + // ISO: bits 16 uint8_t dataBlockBit = DemodBuffer[offset]; offset++; - uint32_t reservedCode = bytebits_to_byteLSBF(DemodBuffer + offset, 14); + // ISO: bits 15 + uint8_t rudiBit = DemodBuffer[offset]; - offset += 14; + offset++; + // ISO: bits 10..14 + uint32_t reservedCode = bytebits_to_byteLSBF(DemodBuffer + offset, 5); + + offset += 5; + // ISO: bits 5..9 + uint32_t userInfo = bytebits_to_byteLSBF(DemodBuffer + offset, 5); + + offset += 5; + // ISO: bits 2..4 + uint32_t replacementNr = bytebits_to_byteLSBF(DemodBuffer + offset, 3); + + offset += 3; uint8_t animalBit = DemodBuffer[offset]; offset++; @@ -289,6 +305,9 @@ int demodFDXB(bool verbose) { PrintAndLogEx(SUCCESS, "Reserved/RFU %u (0x%04X)", reservedCode, reservedCode); PrintAndLogEx(SUCCESS, " Animal bit set? %s", animalBit ? _YELLOW_("True") : "False"); PrintAndLogEx(SUCCESS, " Data block? %s [value 0x%X]", dataBlockBit ? _YELLOW_("True") : "False", extended); + PrintAndLogEx(SUCCESS, " RUDI bit? %s", rudiBit ? _YELLOW_("True") " (advanced transponder)" : "False"); + PrintAndLogEx(SUCCESS, " User Info? %u %s", userInfo, userInfo == 0 ? "(RFU)":""); + PrintAndLogEx(SUCCESS, " Replacement No? %u %s", replacementNr, replacementNr == 0 ? "(RFU)":""); uint8_t c[] = {0, 0}; compute_crc(CRC_11784, raw, sizeof(raw), &c[0], &c[1]);