Added library to read card info, made use of it from within mfkeys.lua script

This commit is contained in:
martin.holst@gmail.com 2013-06-07 13:23:32 +00:00
commit a2d82b467a
2 changed files with 111 additions and 0 deletions

View file

@ -12,6 +12,9 @@
local cmds = require('commands')
-- Load the default keys
local keys = require('mf_default_keys')
-- Ability to read what card is there
local reader = require('read14a')
local desc =
("This script implements check keys. It utilises a large list of default keys (currently %d keys).\
If you want to add more, just put them inside mf_default_keys.lua. "):format(#keys)
@ -103,6 +106,14 @@ local function main()
print(desc);
result, err = reader.read1443a()
if not result then
print(err)
return
end
print(("Found a %s tag"):format(result.name))
core.clearCommandBuffer()
local blockNo
local keyType = 0 -- A=0, B=1