1.2.0 ENABLE.cec

Functions for get/set HDMI CEC settings.

Namespaces

event
mode
status

Methods

static ENABLE.cec.getCecSettings () {Object}

Get HDMI CEC settings.

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.NOT_READY
cec_one_touch_play Boolean HDMI CEC one touch play mode
cec_osd_name String HDMI CEC osd name
cec_remote_control Boolean HDMI CEC remote control mode (only tv2stb is supported in Android)
cec_standby String HDMI CEC standby control mode (off, stb2tv, tv2stb, both)
cec_enable Boolean HDMI CEC status, true if enable

static ENABLE.cec.getTVConfig () {Object}

Gets the configuration of a TV.

ENABLE.cec.getTVConfig()
{ active_port: 4, device: ['Now TV', '', '', 'H205'], power_status: 1, status_code: 'ENTONE.status.SUCCESS' }
Since:
  • 1.2.0
Returns:
Name Type Description
object Object
Name Type Description
power_status Number The power status of TV. Possiable values:
ENABLE.cec.status.OFF
ENABLE.cec.status.ON
ENABLE.cec.status.UNKNOWN_NO_HDMI
ENABLE.cec.status.UNKNOWN_STB_STANDBY
ENABLE.cec.status.UNKNOWN_NO_CEC
ENABLE.cec.status.UNKNOWN_OTHERS
active_port Number A number (1-4) representing the port to activate.
device Array.<string> An array of strings with length of 4, containing the names of CEC devices connected to the TV for each port.
status_code String ENABLE.status.SUCCESS or
ENABLE.status.ERROR

static ENABLE.cec.oneTouchPlay () {Object}

HDMI-CEC one touch play which set the STB as current active source
Notice that this function requires getCecSettings().cec_one_touch_play == true in order to take effect.

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.NOT_READY

static ENABLE.cec.sendVolumeKey (isUp) {Object}

Send volume keys up or down to TV. true for up and false for down.

Name Type Description
isUp Boolean

A boolean value indicating whether to increase the volume ( true ) or decrease it ( false ).

Since:
  • 1.2.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.ERROR or
ENABLE.status.INVALID_ARGUMENT

static ENABLE.cec.setCecSettings (settings) {Object}

Set HDMI CEC settings

Name Type Description
settings Object
Name Type Description
cec_one_touch_play Boolean

HDMI CEC one touch play mode

cec_remote_control Boolean

HDMI CEC remote control mode (only tv2stb is supported in Android)

cec_standby String

HDMI CEC standby control mode (off, stb2tv, tv2stb, both)

cec_enable Boolean

HDMI CEC status, true if enable

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.NOT_READY or
ENABLE.status.INVALID_ARGUMENT

static ENABLE.cec.setEventCallback (callback) {Object}

Register HDMI CEC event callback function.
Only one callback function can be registered. Pass null as callback to unregister.
Example:

var callback = function(obj) {
    if (obj.event === ENABLE.cec.event.HDMI_CEC_STB_SELECTED){
        console.log("STB is now active source!");
    }
};
ENABLE.cec.setEventCallback(callback);
Name Type Description
callback ENABLE.cec~Callback

Callback function.

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.NOT_READY or
ENABLE.status.INVALID_ARGUMENT

static ENABLE.cec.setTVConfig (config) {Object}

Apply configuration to TV. Power on or off and/or activate a specific HDMI port.

Name Type Description
config Object
Name Type Description
power_on Boolean

A boolean value indicating whether to power on (true) or power off (false).

active_port Number

A number (1-4) representing the port to activate.

Since:
  • 1.2.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.ERROR or
ENABLE.status.INVALID_ARGUMENT

Type Definitions

Callback (object)

Callback function for ENABLE.cec.setEventCallback

Name Type Description
object Object
Name Type Description
event Object

Possible values of event:
ENABLE.cec.event.HDMI_CEC_STB_SELECTED
ENABLE.cec.event.HDMI_CEC_STB_UNSELECTED

Since:
  • 1.0.0