chg: added the append_Crc option

This commit is contained in:
iceman1001 2017-12-05 23:41:04 +01:00
commit 2fffe96773

View file

@ -76,7 +76,7 @@ function main(args)
end
local ignore_response = false
local appendcrc = false
local append_crc = false
local stayconnected = false
local payload = nil
local doconnect = true
@ -87,7 +87,7 @@ function main(args)
for o, a in getopt.getopt(args, 'orcpx:dt3') do
if o == "o" then doconnect = false end
if o == "r" then ignore_response = true end
if o == "c" then appendcrc = true end
if o == "c" then append_crc = true end
if o == "p" then stayconnected = true end
if o == "x" then payload = a end
if o == "d" then DEBUG = true end
@ -108,7 +108,7 @@ function main(args)
-- The actual raw payload, if any
if payload then
res,err = sendRaw(payload,{ignore_response = ignore_response, topaz_mode = topaz_mode})
res,err = sendRaw(payload,{ignore_response = ignore_response, topaz_mode = topaz_mode, append_crc = append_crc})
if err then return oops(err) end
if not ignoreresponse then
@ -145,6 +145,9 @@ function sendRaw(rawdata, options)
if options.topaz_mode then
flags = flags + lib14a.ISO14A_COMMAND.ISO14A_TOPAZMODE
end
if options.append_crc then
flags = flags + lib14a.ISO14A_COMMAND.ISO14A_APPEND_CRC
end
local command = Command:new{cmd = cmds.CMD_READER_ISO_14443a,
arg1 = flags, -- Send raw