From 9636574341389c8f63f880f4e37adb0119be0729 Mon Sep 17 00:00:00 2001 From: Thorsten <12600404+bosb@users.noreply.github.com> Date: Sun, 28 Oct 2018 23:34:55 +0100 Subject: [PATCH] Update Sl2s2002.c option bit also for sending security state in single read --- .../Chameleon-Mini/Application/Sl2s2002.c | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/Firmware/Chameleon-Mini/Application/Sl2s2002.c b/Firmware/Chameleon-Mini/Application/Sl2s2002.c index 1feec3f..936bfb8 100644 --- a/Firmware/Chameleon-Mini/Application/Sl2s2002.c +++ b/Firmware/Chameleon-Mini/Application/Sl2s2002.c @@ -78,12 +78,20 @@ uint16_t Sl2s2002AppProcess(uint8_t* FrameBuf, uint16_t FrameBytes) ResponseByteCount = 15; } } else if (Command == ISO15693_CMD_READ_SINGLE) { - if (ISO15693Addressed(FrameBuf, Uid)) { - uint8_t PageAddress = FrameBuf[10]; - FrameBuf[0] = 0; /* Flags */ - MemoryReadBlock(FrameBuf + 1, PageAddress * BYTES_PER_PAGE, BYTES_PER_PAGE); - ResponseByteCount = 5; - } + if (ISO15693Addressed(FrameBuf, Uid)) { + uint8_t PageAddress = FrameBuf[10]; + if (FrameBuf[0] & ISO15693_REQ_FLAG_OPTION) + { + FrameBuf[0] = 0x00; /* Flags */ + FrameBuf[1] = 0x00; /* security dummy to 0 */ + MemoryReadBlock(FrameBuf + 2, PageAddress * BYTES_PER_PAGE, BYTES_PER_PAGE); + ResponseByteCount = 6; + } else { + FrameBuf[0] = 0x00; /* Flags */ + MemoryReadBlock(FrameBuf + 1, PageAddress * BYTES_PER_PAGE, BYTES_PER_PAGE); + ResponseByteCount = 5; + } + } } else if (Command == ISO15693_CMD_READ_MULTIPLE) { if (ISO15693Addressed(FrameBuf, Uid)) { uint16_t PageAddress = FrameBuf[10];