cec
The cec object lets you send messages over CEC (Consumer Electronics Control).
cec IDL
interface ReceiveEvent {
attribute String type;
attribute Array<byte> data;
};
callback ReceiveEventCallback = void (ReceiveEvent event);
interface Cec {
Promise<void> send(Array<byte> data);
void addEventListener(String type, ReceiveEventCallback callback);
void removeEventListener(String type, ReceiveEventCallback callback);
};
Object Creation
To create a cec object, load the @brightsign/cec module using the require()
method.Â
const CecClass = require('@brightsign/cec');
const cec = new CecClass();
Set the specific HDMI port for players with more than one output as follows:
const CecClass = require("@brightsign/cec");
const cec = new CecClass("HDMI-2"); //Modify this to be 'HDMI-1', 'HDMI-2', 'HDMI-3', and 'HDMI-4' as needed
Cec
Event
ReceiveEvent
:  The CEC reception path is implemented as a receive event. The receive message has two generic fields:type
:Â Â The event type "receive"data
:Â Array<byte> CEC frame
Method
send()
Sends messages over cec.
data
Array<byte> : The CEC frame
port_name ()
The parameters for this optional argument are:
default
:Â The default output for the platform, normallyHDMI-1
HDMI-X
: X is a number from 1 up to the number of HDMI® outputs on the platformeARC
: The default for the AU335Â
Note
As of BrightSignOS 8.2.55, the CEC implementation for AU series 5 products will reply to these messages with the correct data, without involving the script:
CEC_MSG_GET_CEC_VERSION
CEC_MSG_ABORT
CEC_MSG_GIVE_DEVICE_POWER_STATUS
CEC_MSG_GIVE_OSD_NAME
CEC_MSG_GIVE_DEVICE_VENDOR_ID
CEC_MSG_GIVE_FEATURES
CEC_MSG_GIVE_PHYSICAL_ADDR
CEC_MSG_USER_CONTROL_PRESSED
CEC_MSG_USER_CONTROL_RELEASED
CEC_MSG_REPORT_PHYSICAL_ADDR
Example
See the following example to send or receive CEC messages. See BSCECTransmitter for an example that turns a display on and off.