Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Source video from HDMI input

Application API Specification

Overall the RDK-CEC library offers 3 categories of application APIs,

HDMI-CEC Connection

  • The Connection APIs allows application to transmit and receive raw data bytes (a.k.a. CEC Frame) that conforms to the HDMI-CEC specification. 
  • This is the only interface that the application can use to access CEC Bus.

HDMI-CEC Message and Frame Structure

  • The Messages APIs allows application to encode high-level message constructs into CECFrame raw bytes, or decode CECFrame raw bytes into high-level message constructs.

HDMI-CEC Library Interface

  • The Library APIs allows application to contrl how the CEC stack operates, such as adding logical address to the stack.

Image Added

The Host interface allows libCEC implementation to interact with the host environment. Such interaction includes monitoring of the Power State change, the HDMI HotPlug events, or API to change the Host State. The Host Interface is delivered as a run-time plugin to the libCEC stack. This allows the CEC stack to run in any devices that implements the Host Interface.

The Driver Component access the HDMI-CEC SoC Driver via the CEC HAL API. The vendors are responsible in delivering a SoC Driver that conforms to the HAL API (see the header file hdmi_cec_driver.h)

Design Details

Methods

NameParametersDescription
setEnabledenabled : booleanEnables or disables CEC
getEnablednoneReturns true if CEC is enabled
setNamename : stringSets the name of the STB device.  The default name is "STB".  It is recommended that the name of the device is set prior to enabling CEC.
getNamenoneReturns the name of the STB device
sendMessage

message : String

The message is a base64 encoded byte array of the raw CEC bytes.  The CEC message includes the device ID for the intended destination.

getCECAddressesnone

return the JSON object <CECAddresses> that is assigned to the local device. It does not contain the <CECAddresses> of other devices on the connected CEC network.

"CECAddresses" : {
"physicalAddress": Array of 4 bytes [byte0, byte1, byte2, byte3],
"logicalAddresses" : Array of <CECLogicalAddress>
}
"CECLogicalAddress" : {
"deviceType" : <string>
"logicalAddress": <integer>
}

The deviceType returned is part or all of devices types optionally set by XRE.

A CEC device can have multiple deviceTypes, if so an array of <CECLogicalAddress> with size more than one is returned.

Default deviceType is Tuner, and its logical Address is either 3, 6, 7, or 10.

In messages sent by XRE, XRE can only use the logicalAddress returned from CECAddresses.

Accepted deviceType are: "Tuner", "Record", "Playback", "AudioSystem", "VideoProcessor", "Switch"

Events

Name

Content

Description

onMessage

message : String

Fired when a message is sent from an HDMI device.  Message is a base64 encoded byte array of the raw CEC bytes.

cecAddressesChangedJSON object <CECAddresses>Notify that address of the host CEC device has changed

...