refactoring NG

This commit is contained in:
iceman1001 2019-05-07 22:59:29 +02:00
commit 3c533db308
2 changed files with 20 additions and 29 deletions

View file

@ -108,9 +108,16 @@ local function waitFor14443b()
return nil, 'Aborted by user'
end
---
-- turns on the HF field.
local function connect14443b()
local c = Command:newMIX{cmd = cmds.CMD_ISO_14443B_COMMAND, arg1 = ISO14B_COMMAND.ISO14B_CONNECT}
return c.sendMIX(true)
end
---
-- Sends an instruction to do nothing, only disconnect
local function disconnect14443b()
local c = Command:newMIX{cmd = cmds.CMD_READER_ISO_14443b}
local c = Command:newMIX{cmd = cmds.CMD_ISO_14443B_COMMAND, arg1 = ISO14B_COMMAND.ISO14B_DISCONNECT}
-- We can ignore the response here, no ACK is returned for this command
-- Check /armsrc/iso14443b.c, ReaderIso14443b() for details
return c.sendMIX(true)
@ -120,6 +127,7 @@ local library = {
read = read14443b,
waitFor14443b = waitFor14443b,
parse1443b = parse1443b,
connect = connect14443b,
disconnect = disconnect14443b,
ISO14B_COMMAND = ISO14B_COMMAND,
}