chg: 'script run ndef_dump' - optional verbose ndefparsing
This commit is contained in:
@@ -27,6 +27,7 @@ script run ndef_dump
|
|||||||
Arguments:
|
Arguments:
|
||||||
-h this help
|
-h this help
|
||||||
-d debug logging on
|
-d debug logging on
|
||||||
|
-v verbose output (from ndef parsing)
|
||||||
|
|
||||||
]]
|
]]
|
||||||
|
|
||||||
@@ -117,9 +118,10 @@ local function main( args)
|
|||||||
dbg('script started')
|
dbg('script started')
|
||||||
local err, data, data2, k, v, i
|
local err, data, data2, k, v, i
|
||||||
-- Read the parameters
|
-- Read the parameters
|
||||||
for o, a in getopt.getopt(args, 'hd') do
|
for o, a in getopt.getopt(args, 'hdv') do
|
||||||
if o == 'h' then return help() end
|
if o == 'h' then return help() end
|
||||||
if o == 'd' then DEBUG = true end
|
if o == 'd' then DEBUG = true end
|
||||||
|
if o == 'v' then verbose = 1 end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- First of all, connect
|
-- First of all, connect
|
||||||
@@ -192,7 +194,7 @@ local function main( args)
|
|||||||
print('Type ', info.name)
|
print('Type ', info.name)
|
||||||
|
|
||||||
local ndefdata = table.concat(blockData, '', 5)
|
local ndefdata = table.concat(blockData, '', 5)
|
||||||
core.ndefparse(t5tarea, 1, ndefdata)
|
core.ndefparse(t5tarea, verbose, ndefdata)
|
||||||
|
|
||||||
for k,v in ipairs(blockData) do
|
for k,v in ipairs(blockData) do
|
||||||
print(string.format('Block %02x: %02x %02x %02x %02x', k-1, string.byte(v, 1,4)))
|
print(string.format('Block %02x: %02x %02x %02x %02x', k-1, string.byte(v, 1,4)))
|
||||||
|
|||||||
Reference in New Issue
Block a user