-- -- ~~~ response record utils -- require("src/utils") -- setup pawsd local pawsd = {} pawsd.tag = require("src/pawsd/tag") -- get number of tags function getrecordtagnumber(response, offset) return tonumber(table.extracthex(response, offset, offset + 1), 16) end -- get all record information function getrecord(response, offset) local tagcount = getrecordtagnumber(response, offset) local tagoffset = offset + 2 local tags = {} for tagindex = 1, tagcount, 1 do local tag = pawsd.tag.get(response, tagoffset) tags[tagindex] = tag.tag tagoffset = tag.endoffset end return { tags = tags, endoffset = tagoffset } end -- return return { get = getrecord }