chg: 'script run ndef_dump' - local functions

This commit is contained in:
iceman1001 2019-01-26 10:40:37 +01:00
commit f760ac99e3

View file

@ -24,13 +24,13 @@ local example = "script run xxx"
local author = "Martin Holst Swende & Asper" local author = "Martin Holst Swende & Asper"
--- ---
-- PrintAndLog -- PrintAndLog
function prlog(...) local function prlog(...)
-- TODO; replace this with a call to the proper PrintAndLog -- TODO; replace this with a call to the proper PrintAndLog
print(...) print(...)
end end
--- ---
-- This is only meant to be used when errors occur -- This is only meant to be used when errors occur
function oops(err) local function oops(err)
prlog("ERROR: ",err) prlog("ERROR: ",err)
return nil,err return nil,err
end end
@ -70,13 +70,13 @@ local utils = {
--- ---
-- Usage help -- Usage help
function help() local function help()
prlog(desc) prlog(desc)
prlog("Example usage") prlog("Example usage")
prlog(example) prlog(example)
end end
function debug(...) local function debug(...)
if DEBUG then if DEBUG then
prlog("debug:", ...) prlog("debug:", ...)
end end
@ -158,7 +158,7 @@ end
--- This function is a lua-implementation of --- This function is a lua-implementation of
-- cmdhf14a.c:waitCmd(uint8_t iSelect) -- cmdhf14a.c:waitCmd(uint8_t iSelect)
function waitCmd(iSelect) local function waitCmd(iSelect)
local response = core.WaitForResponseTimeout(cmds.CMD_ACK,1000) local response = core.WaitForResponseTimeout(cmds.CMD_ACK,1000)
if response then if response then
local count,cmd,arg0,arg1,arg2 = bin.unpack('LLLL',response) local count,cmd,arg0,arg1,arg2 = bin.unpack('LLLL',response)