chg: luascripts now uses t55xx write NG frame format

This commit is contained in:
iceman1001 2019-05-13 16:51:26 +02:00
commit 6a6902e57d
5 changed files with 41 additions and 40 deletions

View file

@ -44,6 +44,7 @@ Arguments:
]]
local DEBUG = true -- the debug flag
local TIMEOUT = 1500
--BLOCK 0 = 00008040 FSK
local config1 = '00'
@ -97,7 +98,9 @@ end
local function test(modulation)
local y
local password = '00000000'
local block = '00'
local flags = '00'
for y = 0x0, 0x1d, 0x4 do
for _ = 1, #procedurecmds do
local pcmd = procedurecmds[_]
@ -108,14 +111,10 @@ local function test(modulation)
local config = pcmd:format(config1, y, modulation, config2)
dbg(('lf t55xx write b 0 d %s'):format(config))
local data = ('%s%s%s%s'):format(utils.SwapEndiannessStr(config, 32), password, block, flags)
config = tonumber(config,16)
local wc = Command:newMIX{
cmd = cmds.CMD_T55XX_WRITE_BLOCK
, arg1 = config
, arg2 = block
}
local response, err = wc:sendMIX(false)
local wc = Command:newNG{cmd = cmds.CMD_T55XX_WRITE_BLOCK, data = data}
local response, err = wc:sendNG(false, TIMEOUT)
if not response then return oops(err) end
else
dbg(pcmd)