fix CMD_HF_MIFARE_READBL not working in Lua scripts after PacketResponseNGPreamble struct split (96d462ace)
This commit is contained in:
1 parent
8728a62933
commit
4a891b3018
1 file changed
+6
-5
@@ -151,10 +151,10 @@ function Command:sendMIX( ignore_response, timeout, use_cmd_ack)
|
|||||||
arg1 = nil
|
arg1 = nil
|
||||||
arg2 = nil
|
arg2 = nil
|
||||||
arg3 = nil
|
arg3 = nil
|
||||||
local count, length, magic, status, crc, ng
|
local count, length, magic, status, reason, crc, ng
|
||||||
|
|
||||||
-- S S I s S L L L
|
-- S S I c c S L L L
|
||||||
count, cmd, length, magic, status, crc, arg1, arg2, arg3 = bin.unpack('SSIsSLLL', response)
|
count, cmd, length, magic, status, reason, crc, arg1, arg2, arg3 = bin.unpack('SSIccSLLL', response)
|
||||||
count, data, ng = bin.unpack('H'..length..'C', response, count)
|
count, data, ng = bin.unpack('H'..length..'C', response, count)
|
||||||
|
|
||||||
local packed = bin.pack("LLLLH", cmd, arg1, arg2, arg3, data)
|
local packed = bin.pack("LLLLH", cmd, arg1, arg2, arg3, data)
|
||||||
@@ -175,9 +175,9 @@ function Command:sendNG( ignore_response, timeout )
|
|||||||
|
|
||||||
data = nil
|
data = nil
|
||||||
cmd = nil
|
cmd = nil
|
||||||
local count, length, magic, status, crc, arg0, arg1, arg2
|
local count, length, magic, status, reason, crc, arg0, arg1, arg2
|
||||||
|
|
||||||
count, cmd, length, magic, status, crc, arg0, arg1, arg2 = bin.unpack('SSIsSLLL', response)
|
count, cmd, length, magic, status, reason, crc, arg0, arg1, arg2 = bin.unpack('SSIccSLLL', response)
|
||||||
count, data, ng = bin.unpack('H'..length..'C', response, count)
|
count, data, ng = bin.unpack('H'..length..'C', response, count)
|
||||||
|
|
||||||
--[[ uncomment if you want to debug
|
--[[ uncomment if you want to debug
|
||||||
@@ -198,6 +198,7 @@ function Command:sendNG( ignore_response, timeout )
|
|||||||
Length = length,
|
Length = length,
|
||||||
Magic = magic,
|
Magic = magic,
|
||||||
Status = status,
|
Status = status,
|
||||||
|
Reason = reason,
|
||||||
Crc = crc,
|
Crc = crc,
|
||||||
Oldarg0 = arg0,
|
Oldarg0 = arg0,
|
||||||
Oldarg1 = arg1,
|
Oldarg1 = arg1,
|
||||||
|
|||||||
Reference in new issue
Block a user