chg: iso15693 lua lib works.

This commit is contained in:
iceman1001
2018-11-30 20:58:47 +01:00
parent 2fb8805ee9
commit 0372cb8a04
2 changed files with 65 additions and 87 deletions

View File

@@ -257,15 +257,23 @@ local Utils =
end,
---
-- Convert Byte array to string of hex
ConvertBytesToHex = function(bytes)
ConvertBytesToHex = function(bytes, reverse)
if bytes == nil then return '' end
if #bytes == 0 then return '' end
local s={}
for i = 1, #bytes do
s[i] = string.format("%02X",bytes[i])
if reverse then
local j=1
for i = #bytes, 1, -1 do
s[i] = string.format("%02X", bytes[j])
j = j + 1
end
else
for i = 1, #bytes do
s[i] = string.format("%02X", bytes[i])
end
end
return table.concat(s)
end,
end,
-- Convert byte array to string with ascii
ConvertBytesToAscii = function(bytes)
if bytes == nil then return '' end