• Quick Start
  • Booting
  • Platform
  • Portals
  • References
    • API Reference TOI3
    • IIP Reference
  • Resources
ARRIS Enterprises, Inc. Confidential Information

ToiPlatformService

Class Summary

Extends:
  • ToiEventTarget

The Platform Service contains functions for rebooting, standby and factory reset.

Service:

This is a service and can be accessed through toi.platformService
  • Methods
  • Members
  • Types
  • Events

Method Summary

createPowerControlInstance ( access )  → ToiPowerControl

This method creates a power control instance that allows an application to do power management.

factoryReset ( flags )

Perform factory reset. Which parts of the persistent storage that is reset to factory state is dependent on which flags that are given to the function call. After the reset is perform, the STB will reboot to ensure that it boots up in a factory reset state.

getDatabases ( )

Get information of the system's databases. Each entry indicates the outcome of the last attempt to open the database. Restarting the system will void previous status.

getPowerControllerInfo ( )  → Array.<ToiPowerControl.ToiPowerControllerInfo>

Returns information of available power controller.

reboot ( rebootType )

Reboot the platform.

Inherited Methods

addEventListener ( type , listener )

This method registers an event listener for a specific event. Multiple listeners can be added for the same event. Events are broadcast to all registered listeners.

removeEventListener ( type , listener )

This method removes an event listener for a specific event.

Type Definitions

ToiComponentState (Type: enum)

The state describing a dynamic component.

  • COMPONENT_STATE_ACTIVE
  • COMPONENT_STATE_INACTIVE
  • COMPONENT_STATE_PENDING_ACTIVE
  • COMPONENT_STATE_PENDING_INACTIVE
ToiDatabaseFlag (Type: enum)

The different outcomes when a database is opened. DATABASE_FLAG_OK and DATABASE_FLAG_FAILED are mutually exclusive. When DATABASE_FLAG_OK is set, other flags can be checked for more detailed database information.

  • DATABASE_FLAG_CREATED_NOW
  • DATABASE_FLAG_FAILED
  • DATABASE_FLAG_OK
  • DATABASE_FLAG_RESTORED_FROM_BACKUP
  • DATABASE_FLAG_RESTORED_FROM_BACKUP_NOW

Technical Preview:

This enumerator is a TECHNICAL PREVIEW, it may change.
ToiDatabaseType (Type: enum)

Enumeration of the system's databases.

  • DATABASE_TYPE_ASSET
  • DATABASE_TYPE_CUSTOM

Technical Preview:

This enumerator is a TECHNICAL PREVIEW, it may change.
ToiRebootType (Type: enum)

The reboot type indicates when to reboot the STB.

  • REBOOT_TYPE_AT_NEXT_STANDBY
  • REBOOT_TYPE_NOW
ToiResetFlag (Type: enum)

The reset flag indicates which parts of the STB that shall be reset when a factory reset is performed.

  • FULL_RESET
  • REFORMAT_INTERNAL_HDD
  • REMOVE_BOOKINGS
  • REMOVE_BOOTLOADER_BYPASS
  • REMOVE_CHANNELS
  • REMOVE_PERSISTENT_COOKIES
  • REMOVE_PERSISTENT_INFORMATION_OBJECTS
  • REMOVE_PORTAL_DATABASES
  • REMOVE_SECONDARY_APPLICATION_DATA
  • RESET_RCU_PAIRING
  • RESET_TR069_DATA_MODEL
ToiTime (Type: number)

Type representing time in seconds since the Unix epoch (1970-01-01 00:00:00).

Technical Preview:

This typedef is a TECHNICAL PREVIEW, it may change.

Events

  • ON_POWER_CONTROLLER_STATUS_CHANGED

Methods

addEventListener ( type , listener )

This method registers an event listener for a specific event. Multiple listeners can be added for the same event. Events are broadcast to all registered listeners.

Inherited From:

  • ToiEventTarget#addEventListener

Parameters:

Name Type Description
type number

The event type of the event to subscribe to.

listener ToiEventListener

The JavaScript function that will receive events.

Throws:

ToiInvalidArgumentException Raised if the event type is not supported by this object or if the listener is not a valid JavaScript function. This exception is also raised if the application calls addEventListener with the same combination of type and listener twice.

createPowerControlInstance ( access )  → ToiPowerControl

This method creates a power control instance that allows an application to do power management.

Parameters:

Name Type Description
access ToiPowerControl.ToiPowerProfileAccess

Determines if the registering application wants to be able to have access to initiate power profile switches.

Throws:

ToiInvalidArgumentException

Raised if the specified application identifier is invalid.

ToiPermissionDeniedException

Raised if an application tries to register for control possibility when the maximum number of applications already has registered for control possibility.

Returns:

Address to an ToiPowerControl interface.

Type: ToiPowerControl
factoryReset ( flags )

Perform factory reset. Which parts of the persistent storage that is reset to factory state is dependent on which flags that are given to the function call. After the reset is perform, the STB will reboot to ensure that it boots up in a factory reset state.

See also:

  • ToiPlatformService.ToiResetFlag

Parameters:

Name Type Description
flags number

Flags indicating which parts to reset.

Throws:

ToiOperationNotSupportedException

Raised if some error occurred.

getDatabases ( )

Get information of the system's databases. Each entry indicates the outcome of the last attempt to open the database. Restarting the system will void previous status.

Technical Preview:

This method is a TECHNICAL PREVIEW, it may change.
getPowerControllerInfo ( )  → Array.<ToiPowerControl.ToiPowerControllerInfo>

Returns information of available power controller.

Technical Preview:

This method is a TECHNICAL PREVIEW, it may change.

Returns:

A sequence of power controller information.

Type: Array.<ToiPowerControl.ToiPowerControllerInfo>
reboot ( rebootType )

Reboot the platform.

Parameters:

Name Type Description
rebootType ToiPlatformService.ToiRebootType

What type of reboot that should take place.

removeEventListener ( type , listener )

This method removes an event listener for a specific event.

Inherited From:

  • ToiEventTarget#removeEventListener

Parameters:

Name Type Description
type number

The event type of the event to remove the listener from.

listener ToiEventListener

The JavaScript function that was previously added as an event listener.

Throws:

ToiInvalidArgumentException Raised if the event type is not supported by this object or if the listener is not a valid JavaScript function. This exception is also raised if the listener has not previously been added.

Members

ON_POWER_CONTROLLER_STATUS_CHANGED (Type: ToiPlatformPowerControllerStatusChangedEvent) (value = 401) (static, constant)

This is an Event identifier for ToiPlatformPowerControllerStatusChangedEvent.

Called when an application has registered or released for power control.

This constant can be also be accessed from toi.consts.ToiPlatformService.ON_POWER_CONTROLLER_STATUS_CHANGED.
COMPONENT_STATE_ACTIVE (Type: ToiPlatformService.ToiComponentState) (value = 4) (static, constant)

The dynamic component is active and ready for use.

This constant can be also be accessed from toi.consts.ToiPlatformService.COMPONENT_STATE_ACTIVE.
COMPONENT_STATE_INACTIVE (Type: ToiPlatformService.ToiComponentState) (value = 1) (static, constant)

The dynamic component is inactive with no resources allocated.

This constant can be also be accessed from toi.consts.ToiPlatformService.COMPONENT_STATE_INACTIVE.
COMPONENT_STATE_PENDING_ACTIVE (Type: ToiPlatformService.ToiComponentState) (value = 3) (static, constant)

The dynamic component has been activated and is allocating its initial resources but is not yet ready for use.

This constant can be also be accessed from toi.consts.ToiPlatformService.COMPONENT_STATE_PENDING_ACTIVE.
COMPONENT_STATE_PENDING_INACTIVE (Type: ToiPlatformService.ToiComponentState) (value = 2) (static, constant)

The dynamic component has been deactivated and is releasing its resources and is not yet ready to be activated again.

This constant can be also be accessed from toi.consts.ToiPlatformService.COMPONENT_STATE_PENDING_INACTIVE.
DATABASE_FLAG_CREATED_NOW (Type: ToiPlatformService.ToiDatabaseFlag) (value = 2) (static, constant)

A new, empty database was created at the most recent startup. Either the database did not exist, or was corrupt and no backup could be restored.

This constant can be also be accessed from toi.consts.ToiPlatformService.DATABASE_FLAG_CREATED_NOW.
DATABASE_FLAG_FAILED (Type: ToiPlatformService.ToiDatabaseFlag) (value = 16) (static, constant)

The database did not exist or was corrupt. No backup could be restored nor could a new database be created.

This constant can be also be accessed from toi.consts.ToiPlatformService.DATABASE_FLAG_FAILED.
DATABASE_FLAG_OK (Type: ToiPlatformService.ToiDatabaseFlag) (value = 1) (static, constant)

The database was opened without problems.

This constant can be also be accessed from toi.consts.ToiPlatformService.DATABASE_FLAG_OK.
DATABASE_FLAG_RESTORED_FROM_BACKUP (Type: ToiPlatformService.ToiDatabaseFlag) (value = 8) (static, constant)

The database was previously restored from a backup.

This constant can be also be accessed from toi.consts.ToiPlatformService.DATABASE_FLAG_RESTORED_FROM_BACKUP.
DATABASE_FLAG_RESTORED_FROM_BACKUP_NOW (Type: ToiPlatformService.ToiDatabaseFlag) (value = 4) (static, constant)

The database was corrupt and a backup was automatically restored at the most recent startup.

This constant can be also be accessed from toi.consts.ToiPlatformService.DATABASE_FLAG_RESTORED_FROM_BACKUP_NOW.
DATABASE_TYPE_ASSET (Type: ToiPlatformService.ToiDatabaseType) (value = 1) (static, constant)

The asset manager database.

This constant can be also be accessed from toi.consts.ToiPlatformService.DATABASE_TYPE_ASSET.
DATABASE_TYPE_CUSTOM (Type: ToiPlatformService.ToiDatabaseType) (value = 0) (static, constant)

A custom/product specific database.

This constant can be also be accessed from toi.consts.ToiPlatformService.DATABASE_TYPE_CUSTOM.
FULL_RESET (Type: ToiPlatformService.ToiResetFlag) (value = 65535) (static, constant)

Perform a full factory reset.

This constant can be also be accessed from toi.consts.ToiPlatformService.FULL_RESET.
REBOOT_TYPE_AT_NEXT_STANDBY (Type: ToiPlatformService.ToiRebootType) (value = 1) (static, constant)

Reboot the platform the next time the system goes from active to standby state. This is used for starting a new boot image in a way that is less disturbing to the end user. Note that ToiInformationService.CFG_STANDBY_ALLOWREBOOT will be checked before box reboot in a standby state. Reboot will happen only when its value is TRUE.

This constant can be also be accessed from toi.consts.ToiPlatformService.REBOOT_TYPE_AT_NEXT_STANDBY.
REBOOT_TYPE_NOW (Type: ToiPlatformService.ToiRebootType) (value = 0) (static, constant)

Reboot the platform immediately in a controlled way. If fast boot is supported the fast boot flag is cleared only if there is an software update available. This is useful to force the usage of a new boot image after upgrade.

This constant can be also be accessed from toi.consts.ToiPlatformService.REBOOT_TYPE_NOW.
REFORMAT_INTERNAL_HDD (Type: ToiPlatformService.ToiResetFlag) (value = 1) (static, constant)

Reformat the internal HDD.

This constant can be also be accessed from toi.consts.ToiPlatformService.REFORMAT_INTERNAL_HDD.
REMOVE_BOOKINGS (Type: ToiPlatformService.ToiResetFlag) (value = 128) (static, constant)

Empties the scheduler database.

This constant can be also be accessed from toi.consts.ToiPlatformService.REMOVE_BOOKINGS.

Technical Preview:

The flag REMOVE_BOOKINGS is a TECHNICAL PREVIEW, it may change.
REMOVE_BOOTLOADER_BYPASS (Type: ToiPlatformService.ToiResetFlag) (value = 512) (static, constant)

Remove bootloader bypass.

This constant can be also be accessed from toi.consts.ToiPlatformService.REMOVE_BOOTLOADER_BYPASS.
REMOVE_CHANNELS (Type: ToiPlatformService.ToiResetFlag) (value = 64) (static, constant)

Remove the channel database.

This constant can be also be accessed from toi.consts.ToiPlatformService.REMOVE_CHANNELS.

Technical Preview:

The flag REMOVE_CHANNELS is a TECHNICAL PREVIEW, it may change.
REMOVE_PERSISTENT_COOKIES (Type: ToiPlatformService.ToiResetFlag) (value = 2) (static, constant)

Remove all persistent cookies for SVG and HTML browsers.

This constant can be also be accessed from toi.consts.ToiPlatformService.REMOVE_PERSISTENT_COOKIES.
REMOVE_PERSISTENT_INFORMATION_OBJECTS (Type: ToiPlatformService.ToiResetFlag) (value = 8) (static, constant)

Remove all persistent InformationService objects, including network, audio and video settings.

This constant can be also be accessed from toi.consts.ToiPlatformService.REMOVE_PERSISTENT_INFORMATION_OBJECTS.
REMOVE_PORTAL_DATABASES (Type: ToiPlatformService.ToiResetFlag) (value = 4) (static, constant)

Remove all local web storage databases for SVG and HTML browsers.

This constant can be also be accessed from toi.consts.ToiPlatformService.REMOVE_PORTAL_DATABASES.
REMOVE_SECONDARY_APPLICATION_DATA (Type: ToiPlatformService.ToiResetFlag) (value = 256) (static, constant)

Remove all storage data for secondary applications.

This constant can be also be accessed from toi.consts.ToiPlatformService.REMOVE_SECONDARY_APPLICATION_DATA.
RESET_RCU_PAIRING (Type: ToiPlatformService.ToiResetFlag) (value = 1024) (static, constant)

Reset RCU pairing.

This constant can be also be accessed from toi.consts.ToiPlatformService.RESET_RCU_PAIRING.
RESET_TR069_DATA_MODEL (Type: ToiPlatformService.ToiResetFlag) (value = 16) (static, constant)

Reset the TR-069 data model.

This constant can be also be accessed from toi.consts.ToiPlatformService.RESET_TR069_DATA_MODEL.
ToiComponentInfo (Type: struct) (static)

Information about a platform component.

Struct fields

Name Description
isDynamic

A flag set to true if the component is dynamic.

Type: boolean
name

The component name.

Type: string
state

The current component state.

Type: ToiPlatformService.ToiComponentState

ToiDatabaseInfo (Type: struct) (static)

Status report for a specific database.

Technical Preview:

This structure is a TECHNICAL PREVIEW, it may change.

Struct fields

Name Description
creationTime

When a database is restored from backup, i.e. when Flags include ToiPlatformService.DATABASE_FLAG_RESTORED_FROM_BACKUP, the creation time indicates the last modification time of the backup file. In all other cases the time the database file was created.

Type: ToiPlatformService.ToiTime
flags

Flags indicating the resulting state after opening the database. ToiPlatformService.ToiDatabaseFlag defines the allowed values.

Type: number
name

Database name.

Type: string
type

The database type.

Type: ToiPlatformService.ToiDatabaseType
version

The version of the database currently open.

Type: string

5.1.p5

Copyright (c) 2017 ARRIS Enterprises, LLC. All Rights Reserved. ARRIS Enterprises, LLC. Confidential Information.