From 4a891b3018acfa2b12f40d5800a36bea20272ec4 Mon Sep 17 00:00:00 2001 From: Denis Bodor Date: Sat, 11 Jul 2026 16:13:33 +0200 Subject: [PATCH] fix CMD_HF_MIFARE_READBL not working in Lua scripts after PacketResponseNGPreamble struct split (96d462ace) --- client/lualibs/commands.lua | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/client/lualibs/commands.lua b/client/lualibs/commands.lua index d10a32cfe..bf5f4f6b5 100644 --- a/client/lualibs/commands.lua +++ b/client/lualibs/commands.lua @@ -151,10 +151,10 @@ function Command:sendMIX( ignore_response, timeout, use_cmd_ack) arg1 = nil arg2 = 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 - count, cmd, length, magic, status, crc, arg1, arg2, arg3 = bin.unpack('SSIsSLLL', response) +-- S S I c c S L L L + count, cmd, length, magic, status, reason, crc, arg1, arg2, arg3 = bin.unpack('SSIccSLLL', response) count, data, ng = bin.unpack('H'..length..'C', response, count) local packed = bin.pack("LLLLH", cmd, arg1, arg2, arg3, data) @@ -175,9 +175,9 @@ function Command:sendNG( ignore_response, timeout ) data = 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) --[[ uncomment if you want to debug @@ -198,6 +198,7 @@ function Command:sendNG( ignore_response, timeout ) Length = length, Magic = magic, Status = status, + Reason = reason, Crc = crc, Oldarg0 = arg0, Oldarg1 = arg1,