FrontPanel
The FrontPanel module is used to control the front panel of the STB. The APIs provided in this module can be used to set the level of the STB's LEDs, and control the output of its 7 segment display (if present).
To retrieve the available properties of the STB's front panel, a call to Platform.System.getInformation() has to be made. The method will return system wide properties, so in order to extract information specific to the front panel, you will have to retrieve them from the 'frontpanel' object of the returned value which is of type FrontPanelInfo.
Members
LEDLevel
Enum for the available LED levels.
Properties:
| Name | Type | Description |
|---|---|---|
| ON | LED level ON | |
| OFF | LED level OFF |
Methods
clearDisplayString()
Clear the front panel display.
Returns:
| Type | Description |
|---|---|
| A promise. | No arguments are passed to the completion handler. |
setDigitSegments(map)
Set front panel segments individually based on the given map. The map value can be broken down into 3 hex digits. The first is a bit map that selects which digit of the display (1 is left, 8 is right most). The next two are a bit map controlling the segments to light. starting with 0x01 being the top progressing clockwise with 0x20 being top left. 0x40 is the centre horizontal bar. 0x80 lights the central colon, regardless for all numeric positions.
Example: to display an 8 at the first position we would use 0x17.
Note: You can't control segments individually per digit - all digits selected must show the same segments.
Parameters:
| Name | Type | Description |
|---|---|---|
map | Number | The bit mask describing which segments to turn on. |
Returns:
| Type | Description |
|---|---|
| A promise. | No arguments are passed to the completion handler. |
setDisplayString(str)
Sets the string to be displayed on the 7 segment display (if available).
Parameters:
| Name | Type | Description |
|---|---|---|
str | String | The string to be displayed on the 7 segment display. |
Returns:
| Type | Description |
|---|---|
| A promise. | No arguments are passed to the completion handler. |
setLEDLevel(id, level)
Set the level of the specified LED. The LEDs information can be retrieved by calling Platform.System.getInformation() and querrying the 'frontpanel' object of the returned value. Then on the 'leds' member array, users can extract various information of the LEDs, including the id of each one of them.
Parameters:
| Name | Type | Description |
|---|---|---|
id | Number | The id of the LED in which the level will be changed. |
level | module:Platform.FrontPanel.LEDLevel | The desired level for the provided LED. |
Returns:
| Type | Description |
|---|---|
| A promise. | No arguments are passed to the completion handler. |
Type Definitions
FrontPanelInfo
Front panel information structure.
Properties:
| Name | Type | Description |
|---|---|---|
display.length | Number | The number of characters in the seven segment display (0 if not present). |
leds | Array | An array of LEDInfo objects containing LED specific properies. |
LEDInfo LED information structure.
Properties:
| Name | Type | Description |
|---|---|---|
id | Number | The id of the LED. It can be used as the first argument of setLEDLevel. |
color | String | The color of the LED in human readable form. |
properties | Array | An Array of strings containing the properties assigned to the LED. May be unique e.g. specifying the "power" LED. |