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:

BSIRReceiver(tvcontroller)

Valid encodings include the following (multiple encodings can be specified in the string using a ";"):

NEC codes are expressed in 24 bits:

note

If the manufacturer code is zero, then the code is considered to be intended for the Roku SoundBridge remote control.

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);
    }
}