chg: enabled param to swap modulation to test

This commit is contained in:
iceman1001 2020-05-15 17:05:33 +02:00
parent 8c65649258
commit 43b5ba4ae2

View file

@ -9,7 +9,7 @@ local floor = math.floor
copyright = '' copyright = ''
author = "Iceman" author = "Iceman"
version = 'v1.0.2' version = 'v1.0.3'
desc =[[ desc =[[
This script will program a T55x7 TAG with a configuration and four blocks of data. This script will program a T55x7 TAG with a configuration and four blocks of data.
It will then try to detect and read back those block data and compare if read data matches the expected data. It will then try to detect and read back those block data and compare if read data matches the expected data.
@ -31,12 +31,17 @@ testsuit for T55XX commands demodulation
]] ]]
example = [[ example = [[
1. script run test_t55x7 1. script run test_t55x7
2. script run test_t55x7 -t FSK2A
3. script run test_t55x7 -t PSK1
]] ]]
usage = [[ usage = [[
script run test_t55x7 [-h] script run test_t55x7 [-h] [-t <modulation type>
]] ]]
arguments = [[ arguments = [[
-h this help -h this help
-t (optional, defaults to ASK) 'PSK1', 'PSK2', 'PSK3',
'FSK1', 'FSK2', 'FSK1A', 'FSK2A',
'ASK', 'BI'
]] ]]
local DEBUG = true -- the debug flag local DEBUG = true -- the debug flag
@ -303,9 +308,11 @@ local function main(args)
print( string.rep('--',20) ) print( string.rep('--',20) )
print( string.rep('--',20) ) print( string.rep('--',20) )
local modulation_type = 'ASK'
-- Arguments for the script -- Arguments for the script
for o, arg in getopt.getopt(args, 'h') do for o, arg in getopt.getopt(args, 'ht:') do
if o == 'h' then return help() end if o == 'h' then return help() end
if o == 't' then modulation_type = arg end
end end
core.clearCommandBuffer() core.clearCommandBuffer()
@ -313,7 +320,8 @@ local function main(args)
-- Adjust this table to set which configurations should be tested -- Adjust this table to set which configurations should be tested
-- local test_modes = { 'PSK1', 'PSK2', 'PSK3', 'FSK1', 'FSK2', 'FSK1A', 'FSK2A', 'ASK', 'BI' } -- local test_modes = { 'PSK1', 'PSK2', 'PSK3', 'FSK1', 'FSK2', 'FSK1A', 'FSK2A', 'ASK', 'BI' }
local test_modes = { 'ASK' } --local test_modes = { 'PSK1' }
local test_modes = { modulation_type }
for _ = 1, #test_modes do for _ = 1, #test_modes do
res = WipeCard() res = WipeCard()