ToiPlatformService Interface Reference


Description

Service:
This is a service and can be accessed through toi.platformService

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

import "ToiPlatformService.idl";

List of all members.

Public Member Functions

void rebootNow ()
void rebootAtNextStandby ()
void setStandby (in boolean mode)
void factoryReset (in long flags) raises (TToiOperationNotSupportedException)
boolean registerComponentUsage (in string componentName) raises (TToiInvalidArgumentException, TToiInvalidPreconditionException)
boolean releaseComponentUsage (in string componentName) raises (TToiInvalidArgumentException, TToiInvalidPreconditionException)
TToiComponentInfoSequence getComponentsInfo ()
ToiPlatformServiceComponentInfo getComponentInfo (in string componentName) raises (TToiInvalidArgumentException)
void addEventListener (in long type, in ToiEventListener listener) raises (TToiInvalidArgumentException)
void removeEventListener (in long type, in ToiEventListener listener) raises (TToiInvalidArgumentException)

Public Attributes

Events

const long ON_COMPONENT_INFO_CHANGED = 400
TToiResetFlag

const TToiResetFlag REFORMAT_INTERNAL_HDD = 0x1
const TToiResetFlag REMOVE_PERSISTENT_COOKIES = 0x2
const TToiResetFlag REMOVE_PORTAL_DATABASES = 0x4
const TToiResetFlag REMOVE_PERSISTENT_INFORMATION_OBJECTS = 0x8
const TToiResetFlag RESET_TR069_DATA_MODEL = 0x10
const TToiResetFlag CUSTOM_POST_PROCEDURE = 0x20
const TToiResetFlag REMOVE_CHANNELS = 0x40
const TToiResetFlag FULL_RESET = 0xff
TToiComponentState

const TToiComponentState COMPONENT_STATE_INACTIVE = 0x1
const TToiComponentState COMPONENT_STATE_PENDING_INACTIVE = 0x2
const TToiComponentState COMPONENT_STATE_PENDING_ACTIVE = 0x3
const TToiComponentState COMPONENT_STATE_ACTIVE = 0x4

Public Types

typedef long TToiResetFlag
typedef long TToiComponentState
typedef sequence
< ToiPlatformServiceComponentInfo
TToiComponentInfoSequence

Member Typedef Documentation

A sequence of component information.

The state describing a dynamic component.

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


Member Function Documentation

void ToiEventTarget::addEventListener ( in long  type,
in ToiEventListener  listener 
) raises (TToiInvalidArgumentException) [inherited]

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.

Parameters:
type The event type of the event to subscribe to.
listener The JavaScript function that will receive events.
Exceptions:
TInvalidArgumentException 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.
void ToiPlatformService::factoryReset ( in long  flags  )  raises (TToiOperationNotSupportedException)

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.

Parameters:
flags Flags indicating which parts to reset.
See also:
ToiPlatformService::TToiResetFlag.
Exceptions:
TToiOperationNotSupportedException Raised if some error occured.
ToiPlatformServiceComponentInfo ToiPlatformService::getComponentInfo ( in string  componentName  )  raises (TToiInvalidArgumentException)
Technical Preview:
This method is a TECHNICAL PREVIEW, it may change.

Returns information for a platform component.

Parameters:
componentName The name of the dynamic component.
Return values:
info Component information.
Exceptions:
TToiInvalidArgumentException Raised if the component name is not valid.
TToiComponentInfoSequence ToiPlatformService::getComponentsInfo (  ) 
Technical Preview:
This method is a TECHNICAL PREVIEW, it may change.

Returns information of available platform components.

Return values:
infoSequence A sequence of component information.
void ToiPlatformService::rebootAtNextStandby (  ) 

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.

void ToiPlatformService::rebootNow (  ) 

Reboot the platform immediately in a controlled way. This is useful to force the usage of a new boot image after upgrade.

boolean ToiPlatformService::registerComponentUsage ( in string  componentName  )  raises (TToiInvalidArgumentException, TToiInvalidPreconditionException)
Technical Preview:
This method is a TECHNICAL PREVIEW, it may change.

Registers interest in a dynamic component. If not already active this method activates the dynamic component with the given identifier. The calling application should register itself as an ToiPlatformObserver and listen to ToiPlatformComponentInfoChangedEvent to know when the component is activated. If the component has already been activated by another user (indicated by the active flag) no event will be sent.

See also:
IToiPlatformObserver
Parameters:
componentName The name of the dynamic component.
Return values:
active A flag indicating if the component is already active, i.e. no need to wait for an active state event.
Exceptions:
TToiInvalidArgumentException Raised if the component name is not valid.
TToiInvalidPreconditionException Raised if the component is in state COMPONENT_STATE_PENDING_INACTIVE.
boolean ToiPlatformService::releaseComponentUsage ( in string  componentName  )  raises (TToiInvalidArgumentException, TToiInvalidPreconditionException)
Technical Preview:
This method is a TECHNICAL PREVIEW, it may change.

Releases interest in a dynamic component with the given identifier. All resources allocated by the dynamic component will be released when it becomes inactive. If another user still has interest in the component it will not be deactivated (indicated by the active flag).

See also:
IToiPlatformObserver
Parameters:
componentName The name of the dynamic component.
Return values:
active A flag indicating if the component is still active after release due to another user, i.e. the component will be inactivated only when all users have released the component.
Exceptions:
TToiInvalidArgumentException Raised if the component name is not valid.
TToiInvalidPreconditionException Raised if the user has not called ToiPlatformService::registerComponentUsage().
void ToiEventTarget::removeEventListener ( in long  type,
in ToiEventListener  listener 
) raises (TToiInvalidArgumentException) [inherited]

This method removes an event listener for a specific event.

Parameters:
type The event type of the event to remove the listener from.
listener The JavaScript function that was previously added as an event listener.
Exceptions:
TInvalidArgumentException 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 had not previously been added.
void ToiPlatformService::setStandby ( in boolean  mode  ) 

Enter or leave standby. In standby all video and audio outputs are disabled. Applications are stopped or left running depending on the system configuration. If the system is already in the requested mode the call will have no effect.

Parameters:
mode The requested mode. True corresponds to standby, while false corresponds to normal operation.

Member Data Documentation

The dynamic component is active and ready for use.

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

The dynamic component is inactive with no resources allocated.

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

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

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

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

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

Execute custom script/procedures. This is done after any other reset actions.

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

Perform a full factory reset.

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

This is an Event identifier for ToiPlatformComponentInfoChangedEvent.

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

Reformat the internal HDD.

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

Technical Preview:
The flag REMOVE_CHANNELS is a TECHNICAL PREVIEW, it may change. Remove the channel database.

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

Remove all persistent cookies for SVG and HTML browsers.

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

Remove all persistent InformationService variables.

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

Remove all portal databases. Currently only affects the HTML browser for which the HTML5 database is removed.

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

Reset the TR-069 data model.

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