This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Log all bus traffic
#4
Something like this, though it will not work on older FW where grp.all function is not implemented.

Code:
if not client then
  require('genohm-scada.eibdgm')

  objects = grp.all()
  datatypes = {}

  for _, object in ipairs(objects) do
    datatypes[ object.id ] = object.datatype
  end

  function writehandler(event)
    local dpt = datatypes[ event.dstraw ]
    if dpt then
      local value = knxdatatype.decode(event.datahex, dpt)
    end
  end

  function readhandler(event)
    log(event)
  end

  client:sethandler('groupwrite', writehandler)
  client:sethandler('groupresponse', writehandler)
  client:sethandler('groupread', readhandler)
end

-- handle knx
client:step()
Reply


Messages In This Thread
Log all bus traffic - by gjniewenhuijse - 12.04.2016, 14:21
RE: Log all bus traffic - by edgars - 15.04.2016, 08:41
RE: Log all bus traffic - by gjniewenhuijse - 19.04.2016, 14:09
RE: Log all bus traffic - by admin - 20.04.2016, 10:08
RE: Log all bus traffic - by Ruslan - 20.04.2016, 12:21
RE: Log all bus traffic - by Ruslan - 26.04.2016, 19:54

Forum Jump: