11.04.2019, 06:27
You need to access metatable to get function list:
For CRC calculation see this post: https://forum.logicmachine.net/showthread.php?tid=808
Code:
function getmetafunctions(object)
local mt = getmetatable(object)
local res = {}
if type(mt) == 'table' then
for k, v in pairs(mt) do
if type(v) == 'function' then
res[ #res + 1 ] = k
end
end
table.sort(res)
end
return res
end
obj = require('luamodbus').rtu()
fns = getmetafunctions(obj)
log(fns)
For CRC calculation see this post: https://forum.logicmachine.net/showthread.php?tid=808