CHG: correct texts, changes to local functions

This commit is contained in:
iceman1001 2017-07-31 15:26:53 +02:00
commit b31fd98055
4 changed files with 30 additions and 47 deletions

View file

@ -21,7 +21,7 @@ The outlined procedure is as following:
-- manchester -- manchester
-- bit rate -- bit rate
"lf t55xx write 0 00008040" "lf t55xx write b 0 d 00008040"
"lf t55xx detect" "lf t55xx detect"
"lf t55xx info" "lf t55xx info"
@ -57,7 +57,7 @@ local procedurecmds = {
} }
--- ---
-- A debug printout-function -- A debug printout-function
function dbg(args) local function dbg(args)
if not DEBUG then if not DEBUG then
return return
end end
@ -74,26 +74,26 @@ function dbg(args)
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)
print("ERROR: ",err) print("ERROR: ",err)
end end
--- ---
-- Usage help -- Usage help
function help() local function help()
print(desc) print(desc)
print("Example usage") print("Example usage")
print(example) print(example)
end end
-- --
-- Exit message -- Exit message
function ExitMsg(msg) local function ExitMsg(msg)
print( string.rep('--',20) ) print( string.rep('--',20) )
print( string.rep('--',20) ) print( string.rep('--',20) )
print(msg) print(msg)
print() print()
end end
function test() local function test()
local y local y
local block = "00" local block = "00"
for y = 0x0, 0x1d, 0x4 do for y = 0x0, 0x1d, 0x4 do
@ -105,7 +105,7 @@ function test()
elseif _ == 1 then elseif _ == 1 then
local config = pcmd:format(config1, y, config2) local config = pcmd:format(config1, y, config2)
dbg(('lf t55xx write 0 %s'):format(config)) dbg(('lf t55xx write b 0 d %s'):format(config))
config = tonumber(config,16) config = tonumber(config,16)
local writecmd = Command:new{cmd = cmds.CMD_T55XX_WRITE_BLOCK,arg1 = config, arg2 = block, arg3 = "00", data = "00"} local writecmd = Command:new{cmd = cmds.CMD_T55XX_WRITE_BLOCK,arg1 = config, arg2 = block, arg3 = "00", data = "00"}

View file

@ -15,7 +15,7 @@ The outlined procedure is as following:
--BIPHASE 00010040 --BIPHASE 00010040
-- --
"lf t55xx write 0 00010040" "lf t55xx write b 0 d 00010040"
"lf t55xx detect" "lf t55xx detect"
"lf t55xx info" "lf t55xx info"
@ -51,7 +51,7 @@ local procedurecmds = {
} }
--- ---
-- A debug printout-function -- A debug printout-function
function dbg(args) local function dbg(args)
if not DEBUG then if not DEBUG then
return return
end end
@ -68,26 +68,26 @@ function dbg(args)
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)
print("ERROR: ",err) print("ERROR: ",err)
end end
--- ---
-- Usage help -- Usage help
function help() local function help()
print(desc) print(desc)
print("Example usage") print("Example usage")
print(example) print(example)
end end
-- --
-- Exit message -- Exit message
function ExitMsg(msg) local function ExitMsg(msg)
print( string.rep('--',20) ) print( string.rep('--',20) )
print( string.rep('--',20) ) print( string.rep('--',20) )
print(msg) print(msg)
print() print()
end end
function test() local function test()
local y local y
local block = "00" local block = "00"
for y = 1, 0x1D, 4 do for y = 1, 0x1D, 4 do
@ -99,7 +99,7 @@ function test()
elseif _ == 1 then elseif _ == 1 then
local config = pcmd:format(config1, y, config2) local config = pcmd:format(config1, y, config2)
dbg(('lf t55xx write 0 %s'):format(config)) dbg(('lf t55xx write b 0 d %s'):format(config))
config = tonumber(config,16) config = tonumber(config,16)
local writecmd = Command:new{cmd = cmds.CMD_T55XX_WRITE_BLOCK,arg1 = config, arg2 = block, arg3 = "00", data = "00"} local writecmd = Command:new{cmd = cmds.CMD_T55XX_WRITE_BLOCK,arg1 = config, arg2 = block, arg3 = "00", data = "00"}

View file

@ -18,7 +18,7 @@ The outlined procedure is as following:
-- FSK1 -- FSK1
-- bit rate -- bit rate
"lf t55xx write 0 00007040" "lf t55xx write b 0 d 00007040"
"lf t55xx detect" "lf t55xx detect"
"lf t55xx info" "lf t55xx info"
@ -54,7 +54,7 @@ local procedurecmds = {
} }
--- ---
-- A debug printout-function -- A debug printout-function
function dbg(args) local function dbg(args)
if not DEBUG then if not DEBUG then
return return
end end
@ -71,26 +71,26 @@ function dbg(args)
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)
print("ERROR: ",err) print("ERROR: ",err)
end end
--- ---
-- Usage help -- Usage help
function help() local function help()
print(desc) print(desc)
print("Example usage") print("Example usage")
print(example) print(example)
end end
-- --
-- Exit message -- Exit message
function ExitMsg(msg) local function ExitMsg(msg)
print( string.rep('--',20) ) print( string.rep('--',20) )
print( string.rep('--',20) ) print( string.rep('--',20) )
print(msg) print(msg)
print() print()
end end
function test(modulation) local function test(modulation)
local y local y
local block = "00" local block = "00"
for y = 0x0, 0x1d, 0x4 do for y = 0x0, 0x1d, 0x4 do
@ -102,7 +102,7 @@ function test(modulation)
elseif _ == 1 then elseif _ == 1 then
local config = pcmd:format(config1, y, modulation, config2) local config = pcmd:format(config1, y, modulation, config2)
dbg(('lf t55xx write 0 %s'):format(config)) dbg(('lf t55xx write b 0 d %s'):format(config))
config = tonumber(config,16) config = tonumber(config,16)
local writecmd = Command:new{cmd = cmds.CMD_T55XX_WRITE_BLOCK,arg1 = config, arg2 = block, arg3 = "00", data = "00"} local writecmd = Command:new{cmd = cmds.CMD_T55XX_WRITE_BLOCK,arg1 = config, arg2 = block, arg3 = "00", data = "00"}

View file

@ -6,7 +6,6 @@ local utils = require('utils')
example =[[ example =[[
1. script run test_t55x7_psk 1. script run test_t55x7_psk
2. script run test_t55x7_psk -o 2. script run test_t55x7_psk -o
]] ]]
author = "Iceman" author = "Iceman"
usage = "script run test_t55x7_psk" usage = "script run test_t55x7_psk"
@ -14,13 +13,9 @@ desc =[[
This script will program a T55x7 TAG with the configuration: block 0x00 data 0x00088040 This script will program a T55x7 TAG with the configuration: block 0x00 data 0x00088040
The outlined procedure is as following: The outlined procedure is as following:
"lf t55xx write 0 00088040" "lf t55xx write b 0 d 00088040"
"lf read" "lf t55xx detect"
"data samples" "lf t55xx info"
"data pskdet"
"data psknrz"
"data pskindala"
"data psknrzraw"
Loop OUTER: Loop OUTER:
change the configuretion block 0 with: change the configuretion block 0 with:
@ -43,17 +38,6 @@ Arguments:
local TIMEOUT = 2000 -- Shouldn't take longer than 2 seconds local TIMEOUT = 2000 -- Shouldn't take longer than 2 seconds
local DEBUG = true -- the debug flag local DEBUG = true -- the debug flag
-- local procedurecmds = {
-- [1] = '%s%s%s%s',
-- [2] = 'lf read',
-- --[3] = '',
-- [3] = 'data samples',
-- [4] = 'data pskdetectclock',
-- [5] = 'data psknrzrawdemod',
-- [6] = 'data pskindalademod',
-- }
-- --BLOCK 0 = 00 08 80 40 PSK -- --BLOCK 0 = 00 08 80 40 PSK
-- ----------- -- -----------
-- 08------- bitrate -- 08------- bitrate
@ -64,12 +48,11 @@ local DEBUG = true -- the debug flag
local procedurecmds = { local procedurecmds = {
[1] = '00%02X%X%X40', [1] = '00%02X%X%X40',
[2] = 'lf t55xx detect', [2] = 'lf t55xx detect',
--[3] = '',
[3] = 'lf t55xx info', [3] = 'lf t55xx info',
} }
--- ---
-- A debug printout-function -- A debug printout-function
function dbg(args) local function dbg(args)
if not DEBUG then if not DEBUG then
return return
end end
@ -86,26 +69,26 @@ function dbg(args)
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)
print("ERROR: ",err) print("ERROR: ",err)
end end
--- ---
-- Usage help -- Usage help
function help() local function help()
print(desc) print(desc)
print("Example usage") print("Example usage")
print(example) print(example)
end end
-- --
-- Exit message -- Exit message
function ExitMsg(msg) local function ExitMsg(msg)
print( string.rep('--',20) ) print( string.rep('--',20) )
print( string.rep('--',20) ) print( string.rep('--',20) )
print(msg) print(msg)
print() print()
end end
function test(modulation) local function test(modulation)
local bitrate local bitrate
local clockrate local clockrate
local block = "00" local block = "00"
@ -123,7 +106,7 @@ function test(modulation)
dbg("Writing to T55x7 TAG") dbg("Writing to T55x7 TAG")
local config = cmd:format(bitrate, modulation, clockrate) local config = cmd:format(bitrate, modulation, clockrate)
dbg(('lf t55xx write 0 %s'):format(config)) dbg(('lf t55xx write b 0 d %s'):format(config))
config = tonumber(config,16) config = tonumber(config,16)
local writecmd = Command:new{cmd = cmds.CMD_T55XX_WRITE_BLOCK,arg1 = config, arg2 = block, arg3 = "00", data = "00"} local writecmd = Command:new{cmd = cmds.CMD_T55XX_WRITE_BLOCK,arg1 = config, arg2 = block, arg3 = "00", data = "00"}