From fda9f07894e2022f022bb31d51741965a5ec0446 Mon Sep 17 00:00:00 2001 From: Federico Cerutti Date: Mon, 10 Dec 2018 12:55:38 +0100 Subject: [PATCH] Fixed a bug in write and lock commands - Missing parenthesis --- Firmware/Chameleon-Mini/Application/TITagitstandard.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Firmware/Chameleon-Mini/Application/TITagitstandard.c b/Firmware/Chameleon-Mini/Application/TITagitstandard.c index f5618f5..80ae1a2 100644 --- a/Firmware/Chameleon-Mini/Application/TITagitstandard.c +++ b/Firmware/Chameleon-Mini/Application/TITagitstandard.c @@ -114,10 +114,12 @@ uint16_t TITagitstandardAppProcess(uint8_t* FrameBuf, uint16_t FrameBytes) if (FrameInfo.ParamLen != 5) break; /* malformed: not enough or too much data */ - if (PageAddress > TITAGIT_NUMBER_OF_SECTORS) + if (PageAddress > TITAGIT_NUMBER_OF_SECTORS) { FrameBuf[ISO15693_ADDR_FLAGS] = ISO15693_RES_FLAG_ERROR; FrameBuf[ISO15693_RES_ADDR_PARAM] = ISO15693_RES_ERR_OPT_NOT_SUPP; + ResponseByteCount = 2; break; /* malformed: trying to write in a non-existing block */ + } Dataptr = PageAddress + 0x01; @@ -141,11 +143,12 @@ uint16_t TITagitstandardAppProcess(uint8_t* FrameBuf, uint16_t FrameBytes) if (FrameInfo.ParamLen != 1) break; /* malformed: not enough or too much data */ - if (PageAddress > TITAGIT_NUMBER_OF_SECTORS) + if (PageAddress > TITAGIT_NUMBER_OF_SECTORS) { FrameBuf[ISO15693_ADDR_FLAGS] = ISO15693_RES_FLAG_ERROR; FrameBuf[ISO15693_RES_ADDR_PARAM] = ISO15693_RES_ERR_OPT_NOT_SUPP; ResponseByteCount = 2; break; /* malformed: trying to lock a non-existing block */ + } if ((FactoryLockBits_Mask & (1 << PageAddress)) || (UserLockBits_Mask & (1 << PageAddress))) { FrameBuf[ISO15693_ADDR_FLAGS] = ISO15693_RES_FLAG_ERROR;