Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision |
livebox:hah_plugboard_v2 [2013/12/27 03:51] – [Writing xAP Lua applications] brett | livebox:hah_plugboard_v2 [2014/01/03 02:33] – [Filter] brett |
---|
^^ **Return Type** ^^ **Method** ^^ **Description** ^^ | ^^ **Return Type** ^^ **Method** ^^ **Description** ^^ |
|| Filter || xap.Filter(filter) || Constructor || | || Filter || xap.Filter(filter) || Constructor || |
| || void || <obj>:destroy() || Destructor || |
|| void || <obj>:add(section,key,value) || A condition matching an inbound xAP message, as many filters as needed can be added to the Filter object for matching. || | || void || <obj>:add(section,key,value) || A condition matching an inbound xAP message, as many filters as needed can be added to the Filter object for matching. || |
| || void || <obj>:delete(section,key,value) || Removing a matching condition from a filter || |
|| void || <obj>:callback(function, userdata) || When all the filter conditions are met invoke the function, the function has a single parameter this is the FRAME matched by the filters. The function passed will receive as parameters (frame, userdata) || | || void || <obj>:callback(function, userdata) || When all the filter conditions are met invoke the function, the function has a single parameter this is the FRAME matched by the filters. The function passed will receive as parameters (frame, userdata) || |
| |
end | end |
| |
xap.init("dbzoo.lua.test","FF00CC00") | xap.init{instance="test",uid="FF00CC00"} |
f = xap.Filter() | f = xap.Filter() |
f:add("xap-hbeat","source",xap.FILTER_ANY) | f:add("xap-hbeat","source",xap.FILTER_ANY) |
end | end |
| |
xap.init("dbzoo.lua.socket","FF00CC00","br0") | xap.init{instance="socket",uid="FF00CC00"} |
| |
print("Binding to host '" ..host.. "' and port " ..port.. "...") | print("Binding to host '" ..host.. "' and port " ..port.. "...") |
^^ **Return Type** ^^ **Method** ^^ **Description** ^^ | ^^ **Return Type** ^^ **Method** ^^ **Description** ^^ |
|| Endpoint || Endpoint(table) || Constructor: a container to hold endpoints || | || Endpoint || Endpoint(table) || Constructor: a container to hold endpoints || |
| || nil || <obj>:destroy() || Destructor: remove the endpoint from existence || |
|| nil || <obj>:sendEvent() || Send xAPBSC.event for this endpoint || | || nil || <obj>:sendEvent() || Send xAPBSC.event for this endpoint || |
|| nil || <obj>:sendInfo() || Send xAPBSC.info for this endpoint || | || nil || <obj>:sendInfo() || Send xAPBSC.info for this endpoint || |
require("xap.bsc") | require("xap.bsc") |
| |
xap.init("dbzoo.livebox.test","FF00AA00") | xap.init{instance="test",uid="FF00AA00"} |
| |
bsc.sendState("dbzoo.livebox.Controller:relay.1", "on") | bsc.sendState("dbzoo.livebox.Controller:relay.1", "on") |