Namespace: stbUpdate

stbUpdate

The object provides an interface to the update manager (handles software updates subsystem operations).

Update Manager allows you to initiate and display the status of the software upgrade procedure. Before any software update operation you must stop every single process of media content accessing and displaying.

Update manager is a finite state machine. State is accessible via stbUpdate.getStatus method. Initial state "Idle" (value "21"). Any active operation upon the update system is only allowed in one of final states (for example "Idle"). Right after starting of an operation state machine should be considered as busy until any of final states is settled back.

Methods

getActiveBank

<static> getActiveBank () → {number}

Return memory bank number, that has been used for current software boot.

Since:
  • 0.2.16
Returns:
Type Description

number

possible values:

Value Description
0 first memory bank
1 second memory bank
-1 memory bank is undefined (it could be possible if device was booted from network storage, e.g. NFS)

GetFlashBankCount

<static> GetFlashBankCount () → {number}

Return total number of banks available for update.

Since:
  • 0.2.16
Returns:
Type Description

number

if everything is fine at least one bank should be available [0..n]

getImageDateStr

<static> getImageDateStr () → {string}

Return timestamp of "Update Image" file that has been read during last successful "Check" operation.

Since:
  • 0.2.16
Returns:
Type Description

string

timestamp expressed in image-specific format

Example

'Thu Nov 3 15:07:57 EET 2011'

getImageDescStr

<static> getImageDescStr () → {string}

Return description of "Update Image" file that has been read during last successful "Check" operation.

Since:
  • 0.2.16
Returns:
Type Description

string

description

Example

'0.2.12-250-alpha'

getImageVersionStr

<static> getImageVersionStr () → {string}

Return version of "Update Image" file that has been read during last successful "Check" operation.

Since:
  • 0.2.16
Returns:
Type Description

string

version

Example

'211'

getPercents

<static> getPercents () → {number}

Return a progress indicator value for pending update operation.

Since:
  • 0.2.16
Returns:
Type Description

number

value expressed in percents [0..100]

getStatus

<static> getStatus () → {number}

Return the last available status code for an update operation.

Since:
  • 0.2.16
Returns:
Type Description

number

possible values:

Value Description
-1 Not defined
1 Signature init error (final state error)
2 Wrong device model
3 Section size exceeds partition size on FLASH
4 Required FLASH section not found. Aborting update
5 Updating kernel
6 Updating image
7 Internal error (final state error)
8 Inspecting firmware
9 Updating environment variables
10 Updating Bootstrap section
11 Skipping Bootstrap section
12 Updating User FS section
13 Skipping User FS section
14 Updating second boot
15 Updating logotype
16 Update finished OK (final state OK)
17 Wrong signature (final state OK)
18 Erasing flash section
19 Flash write error (final state error)
20 File write error (final state error)
21 Idle (final state OK)
22 Invalid file header (final state error)
23 Inspecting update file
23 File check finished
24 File check finished (final state OK)
25 File not found (final state error)
26 Initialising
27 Read error (final state error)

getStatusStr

<static> getStatusStr () → {string}

Return the last available status for an update operation.

Returns:
Type Description

string

status description string

localization will be done according to settings of internal portal

setAutoUpdateInitAttr

<static> setAutoUpdateInitAttr ( options )

Set URL for "Auto Update" web window.

Parameters:
Name Type Description

options

string

parameters from function stbWindowMgr.windowInit

Since:
  • 0.2.18

Example

stbUpdate.setAutoUpdateInitAttr('{"url":"/home/web/system/updater/index.html"}');

startAutoUpdate

<static> startAutoUpdate ( imageUrl, checkVersion )

Start an automatic software update procedure.

Dedicated web window will be opened using URL "imageUrl".

Parameters:
Name Type Description

imageUrl

string

"Update Image" file address, can be in following forms:

  • URL pointing to the update file using HTTP scheme (e.g. http://test.com/imageupdate)
  • file path to the update file (e.g. /media/usbdisk/mag200/imageupdate)

checkVersion

boolean

possible values:

Value Description
true commit update procedure only if current version of software older than available version
false unconditional update
Since:
  • 0.2.16

startCheck

<static> startCheck ( imageUrl )

Start a metadata inspection for "Update Image" file.

Parameters:
Name Type Description

imageUrl

string

file address which will be inspected for available metadata, can be in following forms:

  • URL pointing to the update file using HTTP scheme (e.g. http://test.com/imageupdate)
  • file path to the update file (e.g. /media/usbdisk/mag200/imageupdate)
Since:
  • 0.2.16

startUpdate

<static> startUpdate ( bankIndex, imageUrl )

Start a software update using "Update Image" file.

Parameters:
Name Type Description

bankIndex

number

possible values:

Value Description
0 use first memory bank
1 use second memory bank

imageUrl

string

"Update Image" file address, can be in following forms:

  • URL pointing to the update file using HTTP scheme (e.g. http://test.com/imageupdate)
  • file path to the update file (e.g. /media/usbdisk/mag200/imageupdate)
Since:
  • 0.2.16