From 5093fb9e07070590e4f2b399c58a1fc8702e584d Mon Sep 17 00:00:00 2001 From: Dom Date: Fri, 6 Apr 2018 09:34:47 +0100 Subject: [PATCH] Added error checking for RATS and PPS check. --- client/scripts/mifarePlus.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/client/scripts/mifarePlus.lua b/client/scripts/mifarePlus.lua index c0fa5283..85815093 100644 --- a/client/scripts/mifarePlus.lua +++ b/client/scripts/mifarePlus.lua @@ -265,8 +265,14 @@ function main(args) -- Initialize the card using the already-present read14a library info,err = lib14a.read14443a(true, false) --Perform PPS (Protocol and Parameter Selection) check to finish the ISO 14443-4 protocol. - sendRaw("e050", true, true) - sendRaw("D01100", true, true) + response = sendRaw("e050", true, true) + if(response == nil) then + err = "No response from RATS" + end + response = sendRaw("D01100", true, true) + if(response == nil) then + err = "No response from PPS check" + end if err then oops(err) else