This commit is contained in:
iceman1001 committed 2019-04-29 01:51:00 +02:00
1 parent 47fbb557b4
commit 2b561ad732
2 files changed
+43 -41

No files matched your search

+5 -6
View File
@@ -77,15 +77,14 @@ end
local function getblockdata(response)
if not response then
return nil, 'No response from device'
end
end
local count, cmd, arg0 = bin.unpack('LL', response)
local count, cmd, arg0, arg1, arg2, data = bin.unpack('LLLLH40', response)
if arg0 == 1 then
local count, arg1, arg2, data = bin.unpack('LLH511', response, count)
return data:sub(1, 32)
else
return nil, "Couldn't read block"
end
end
return nil, "Couldn't read block"
end
---_ Gets data from a block
-- @return {block, block+1, block+2, block+3} if successfull