From 7cd9f20efbd6b66b3aefed77472ecf419262bb4c Mon Sep 17 00:00:00 2001 From: Yann GASCUEL <34003959+lnv42@users.noreply.github.com> Date: Fri, 19 Jan 2024 17:30:46 +0100 Subject: [PATCH] iso15sim: add support for addressed requests including IC number --- armsrc/iso15693.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/armsrc/iso15693.c b/armsrc/iso15693.c index 46016f725..7212256fa 100644 --- a/armsrc/iso15693.c +++ b/armsrc/iso15693.c @@ -2330,10 +2330,14 @@ void SimTagIso15693(uint8_t *uid, uint8_t block_size) { continue; if (memcmp(&cmd[cmdCpt], tag->uid, 8) != 0) { - if (g_dbglevel >= DBG_DEBUG) Dbprintf("Address don't match tag uid"); - if (cmd[1] == ISO15693_SELECT) - tag->state = TAG_STATE_READY; // we are not anymore the selected TAG - continue; // drop addressed request with other uid + if (cmd[cmdCpt] != tag->ic || cmd_len < cmdCpt+9 \ + || memcmp(&cmd[cmdCpt+1], tag->uid, 8) != 0) + { // check uid even if IC is present + if (g_dbglevel >= DBG_DEBUG) Dbprintf("Address don't match tag uid"); + if (cmd[1] == ISO15693_SELECT) + tag->state = TAG_STATE_READY; // we are not anymore the selected TAG + continue; // drop addressed request with other uid + } } if (g_dbglevel >= DBG_DEBUG) Dbprintf("Address match tag uid"); cmdCpt+=8;