From 77d1a423d575cfce6cbc46ff8e2217db2b6483d9 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Sun, 13 Mar 2016 07:17:26 +0100 Subject: [PATCH] CHG: minor changes to this lua script. One case it returns NIL, which makes it behave better. --- client/lualibs/read14b.lua | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/client/lualibs/read14b.lua b/client/lualibs/read14b.lua index ab51f8bf..49e3d0e7 100644 --- a/client/lualibs/read14b.lua +++ b/client/lualibs/read14b.lua @@ -96,7 +96,7 @@ local function select1443b() local result, infoReqb, infoAttrib, infoPong, err, resp, len, data local goodReqbResponse = false --REQB - local p = 5 + local p = 20 while p > 0 do -- 05 00 08 -- 05 @@ -122,10 +122,10 @@ local function select1443b() end -- send some strange 0A/0C - if ( p < 3) then - sendRaw('0A', 0, 0) - sendRaw('0C', 0, 0) - end + -- if ( p < 3) then + -- sendRaw('0A', 0, 0) + -- sendRaw('0C', 0, 0) + -- end p = p - 1 print('retrying') @@ -200,6 +200,7 @@ local function waitFor14443b() while not core.ukbhit() do res, err = select1443b() if res then return res end + if res == nil then return nil, err end -- err means that there was no response from card end return nil, "Aborted by user" -- 2.39.2