From 541ef26c391f3f96a17c476f91c55effc008c186 Mon Sep 17 00:00:00 2001 From: douniwan5788 Date: Sat, 24 Aug 2024 22:31:37 +0800 Subject: [PATCH] fix: Display a more meaningful error message when attempting to write to a Hitag S tag in authentication mode using plain mode commands. --- armsrc/hitagS.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/armsrc/hitagS.c b/armsrc/hitagS.c index 74a6d2a64..cc76614a9 100644 --- a/armsrc/hitagS.c +++ b/armsrc/hitagS.c @@ -1360,8 +1360,11 @@ static int selectHitagS(const lf_hitag_data_t *packet, uint8_t *tx, size_t sizeo tx[i] = ((NrAr >> (56 - (i * 8))) & 0xFF); } + } else if (packet->cmd == RHTSF_PLAIN || packet->cmd == WHTSF_PLAIN) { + Dbprintf("Error, " _YELLOW_("AUT=1") " This tag is configured in Authentication Mode"); + return -1; } else { - Dbprintf("Error , unknown function: " _RED_("%d"), packet->cmd); + Dbprintf("Error, unknown function: " _RED_("%d"), packet->cmd); return -1; }