Player APIs (BrightScript & Ja...
BrightScript-JavaScript Object...
BSIRReceiver
7min
this class receives ir events for more information, refer to the object reference manual entry on roirreceiver object creation a bsirreceiver object must specify the hardware interface that will receive ir events, as well as the encoding(s) to look for bsirreceiver(domstring interface, domstring encoding) valid hardware interfaces include the following "gpio" pin 1 of the gpio connector "ir in" the 3 5mm ir input/output connector "iguana" the iguanaworks http //iguanaworks net/ ir transceiver this source can support both nec and rc5 encodings simultaneously “tvcontroller” this virtual ir driver is only available on brightsign built in products it reads the ir messages from uart and drives the roirreceiver object like other ir receivers a creation example would be bsirreceiver(tvcontroller) valid encodings include the following (multiple encodings can be specified in the string using a ";") "nec" "rc5" (supported on the iguanaworks device only) nec codes are expressed in 24 bits bits 0 7 button code bits 8 23 manufacturer code if the manufacturer code is zero, then the code is considered to be intended for the roku soundbridge remote control methods void close() shuts down the instance, preventing it from further consuming resources if this method is not called, garbage collection determines when the instance will be destroyed events these events are available on the bsirreceiver object each event can receive an irreceiverevent event onremotedown onremoterepeat onremoteup (supported on the iguanaworks device only) irreceiverevent – attributes readonly attribute domstring irtype; readonly attribute unsigned long code; example the following javascript example displays messages on the log when remote codes are received function myfunction() { var ir receiver = new bsirreceiver("ir in","nec"); ir receiver onremotedown = function(e){ console log('############ onremotedown ' + e irtype + " " + e code); } ir receiver onremoteup = function(e){ console log('############ onremoteup ' + e irtype + " " + e code); } }