From bda0d7e04bd6ee33225e427e8a6eaf33a87aee61 Mon Sep 17 00:00:00 2001 From: Dom Date: Fri, 6 Apr 2018 09:00:43 +0100 Subject: [PATCH] Created parameter in CommitPerso() function. --- client/scripts/mifarePlus.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/scripts/mifarePlus.lua b/client/scripts/mifarePlus.lua index 5d8c4e7d..257fdc94 100644 --- a/client/scripts/mifarePlus.lua +++ b/client/scripts/mifarePlus.lua @@ -153,9 +153,9 @@ function getVersion() sendRaw(GETVERS_CONT, true, true) end -function commitPerso() - -- commandString = COMMITPERSO .. "01" --switch to SL1 - commandString = COMMITPERSO .. "03" --switch to SL3 +function commitPerso(SL) + --pass SL as "01" to move to SL1 or "03" to move to SL3. + commandString = COMMITPERSO .. SL response = sendRaw(commandString, true, true) --0x90 is returned upon success if string.sub(response, 3, 4) ~= "90" then oops("error occurred while trying to switch security level") @@ -268,7 +268,7 @@ function main(args) -- Now, the card is initialized and we can do more interesting things. --writePerso() - --commitPerso() + --commitPerso("03") --move to SL3 --getVersion() proximityCheck()