livebox:hah_plugboard_v2

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
livebox:hah_plugboard_v2 [2013/12/27 04:08] – [Select] brettlivebox:hah_plugboard_v2 [2015/01/20 00:37] (current) – [BSC] Explain input/output direction values. brett
Line 167: Line 167:
 ^^ **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) ||
  
Line 256: Line 258:
  
 <code lua> <code lua>
 +require "xap"
 elapsed = 0 elapsed = 0
  
-function tick(self)+function tick(self, userdata)
   elapsed = elapsed + self.interval   elapsed = elapsed + self.interval
   print("Tick "..elapsed)   print("Tick "..elapsed)
   if elapsed > 10 then   if elapsed > 10 then
-    print(self.userdata)+    print(userdata)
     self:stop()     self:stop()
   end     end  
Line 268: Line 271:
  
 xap.Timer(tick, 2, "user data!"):start() xap.Timer(tick, 2, "user data!"):start()
 +xap.process()
 </code> </code>
  
Line 370: Line 374:
 ^^ **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 ||
Line 388: Line 393:
 **instance**: xAP address for the endpoint.  Completes the triple; vendorid.deviceid.(instance) **instance**: xAP address for the endpoint.  Completes the triple; vendorid.deviceid.(instance)
  
-**direction**: Has two possible values bsc.INPUT and bsc.OUTPUT+**direction**: Has two possible values bsc.INPUT and bsc.OUTPUT.  An OUTPUT endpoint will respond to xAPBSC.cmd events, INPUTS will not.
  
 **type**: BSC supports 3 endpoint types: bsc.STREAM, bsc.LEVEL and bsc.BINARY **type**: BSC supports 3 endpoint types: bsc.STREAM, bsc.LEVEL and bsc.BINARY
Line 554: Line 559:
 The **init()** function will be invoked when the applet is loaded by the plugboard.lua script. The **init()** function will be invoked when the applet is loaded by the plugboard.lua script.
  
-To be automatically loaded they must be placed in the /etc/plugboard directory and have the suffix Applet.lua.  Example file names:+**To be automatically loaded they must be placed in the /etc/plugboard directory and have the suffix Applet.lua.**  Example file names:
   * hbeatWatchdogApplet.lua   * hbeatWatchdogApplet.lua
   * bindRelaysApplet.lua   * bindRelaysApplet.lua
  • livebox/hah_plugboard_v2.1388117285.txt.gz
  • Last modified: 2013/12/27 04:08
  • by brett