From 4b18370dfacd3302a3f5a868be151254d8933fc1 Mon Sep 17 00:00:00 2001 From: g3gg0 Date: Sat, 26 Nov 2022 16:31:32 +0100 Subject: [PATCH] fix SLIX/SLIX2 type indicator bits --- lib/nfc/protocols/slix.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/nfc/protocols/slix.c b/lib/nfc/protocols/slix.c index ca3ebcd67..d8befc399 100644 --- a/lib/nfc/protocols/slix.c +++ b/lib/nfc/protocols/slix.c @@ -6,12 +6,16 @@ #include #include "furi_hal_nfc.h" +uint8_t slix_get_ti(FuriHalNfcDevData* nfc_data) { + return (nfc_data->uid[3] >> 3) & 3; +} + bool slix_check_card_type(FuriHalNfcDevData* nfc_data) { if((nfc_data->uid[0] == 0xE0) && (nfc_data->uid[1] == 0x04) && (nfc_data->uid[2] == 0x01) - && (((nfc_data->uid[3] >> 4) & 3) == 2)) { + && slix_get_ti(nfc_data) == 2) { return true; } return false; @@ -21,7 +25,7 @@ bool slix2_check_card_type(FuriHalNfcDevData* nfc_data) { if((nfc_data->uid[0] == 0xE0) && (nfc_data->uid[1] == 0x04) && (nfc_data->uid[2] == 0x01) - && (((nfc_data->uid[3] >> 4) & 3) == 1)) { + && slix_get_ti(nfc_data) == 1) { return true; } return false;