System
The system module provides some device-level functions.
System Information.
The getInformation function returns generic system related information for the set top box.
Reboot & Standby
Call the setStandbyMode function to put the box to sleep. Call the reboot function to restart the box. Notice that the standby state is maintained when we reboot.
Firmware Update.
Call findUpdate to start a search for updates. If one exists, call getUpdateVersion to get its version number. You can compare that number with the one you got from getInformation. If you wish to perform the update, call scheduleUpdateInstallation and it will be installed once the box reboots.
Factory Reset.
Call startFactoryReset to reset the permanent memory.
Members
FactoryResetType
Enum for the desired factory reset type we wish to perform on the machine.
Properties:
| Name | Type | Description |
|---|---|---|
NAND | Number | Erase the NAND flash partitions. |
onFirmwareUpdateSearchFinish
Signal fired when the system search for new firmware is finished. The listener will be passed the following arguments:
- status: A number representing search result according to UpdateSearchResult.
onSTRWakeUp
Signal fired when the system wakes up from suspend-to-ram standby mode.
StandbyMode
Enum for the standby mode.
Properties:
| Name | Type | Description |
|---|---|---|
OFF | Exit standby mode. | |
ACTIVE | Enter active standby mode. Disables video and audio output without turning off the STB. | |
PASSIVE | Enter passive standby mode. Effectively turns off the STB. Use the power button to turn it back on. | |
STR | Enter suspend-to-ram standby mode. Low latency, high energy saving standby mode. Turns off most system components except the ones related to main memory. Use the power button to turn it back on. |
UpdateSearchResult
Enum for the status of an update search operation.
Properties:
| Name | Type | Description |
|---|---|---|
NO_UPDATE | No update available. | |
UPDATE_ON_SERVER | An update has been found on the remote server. | |
UPDATE_ON_USB | An update has been found on a connected usb device. | |
UPDATE_ON_MULTICAST | Multicast update has been found. |
MediaEngineTempSensor
Enum for the target temperature sensor.
Properties:
| Name | Type | Description |
|---|---|---|
MEDIA_ENGINE_TEMP_SOC0 | Temp sensor SoC0. |
Methods
findUpdate()
Start a search for updates.
Returns:
| Type | Description |
|---|---|
| A promise. | The completion handler will be passed the following arguments: - result: The UpdateSearchResult of the requested search. |
getInformation()
Retrieve general system related information.
Returns:
| Type | Description |
|---|---|
| A promise. | The completion handler will be passed the following arguments: - info: A SystemInfo object with system related information. |
getSoftwareVersion()
Get the software version.
Returns:
| Type | Description |
|---|---|
| A promise. | The completion handler will be passed the following arguments: - version: A string representing the platform's software version. |
getStandbyMode()
Get the current standby mode.
Returns:
| Type | Description |
|---|---|
| A promise. | The completion handler will be passed the following arguments: - mode: The current StandbyMode. |
getUpdateVersion()
If an update was found, its firmware version will be returned.
Returns:
| Type | Description |
|---|---|
| A promise. | The completion handler will be passed the following arguments: - version: The version of the update. |
reboot()
Reboot the STB.
Notice: This function does not have a synchronous version.
Returns:
| Type | Description |
|---|---|
| A promise. | No arguments are passed to the completion handler. |
scheduleUpdateInstallation()
If an update was found, it will be scheduled for installation upon the next reboot.
Returns:
| Type | Description |
|---|---|
| A promise. | No arguments are passed to the completion handler. |
setStandbyMode(mode)
Set the standby mode.
Parameters:
| Name | Type | Description |
|---|---|---|
mode | StandbyMode | The desired StandbyMode. |
Returns:
| Type | Description |
|---|---|
| A promise. | No arguments are passed to the completion handler. |
getTemperature(sensor)
Get the temperature in degrees C recorded by the given sensor.
Parameters:
| Name | Type | Description |
|---|---|---|
sensor | MediaEngineTempSensor | The desired sensor to read. |
Returns:
| Type | Description |
|---|---|
| A promise. | The completion handler will be passed the following arguments: - temp: The temperature in degrees C. |
startFactoryReset(reset_type)
Perform a factory reset on the machine.
Parameters:
| Name | Type | Description |
|---|---|---|
reset_type | FactoryResetType | The desired FactoryResetType. |
Returns:
| Type | Description |
|---|---|
| A promise. | No arguments are passed to the completion handler. |
Type Definitions
SystemInfo
A generic system information structure.
Parameters:
| Name | Type | Description |
|---|---|---|
serial | String | The serial number of the set top box. |
firmware | String | The firmware version of the set top box. |
loader | String | The loader version of the set top box. |
boardmodel | String | The set top box board model. |
tuner | Array | The available tuners of the set top box. |
networkadapter | Array | The available network adapters of the set top box. |
powermodes | Array | The supported power modes of the set top box. |
frontpanel | module:Platform.FrontPanel.FrontPanelInfo | Front panel related information. |