dvbManager

dvbManager

Deprecated:
  • Yes
See:

Main object to manage DVB-C/T/T2 subsystem for MAG270/MAG275 boards only.

To start playback of DVB channel player should be started with the following URL: dvb://<channel_id>
where channel_id can be obtained from "id" field in the result of calling dvbManager.GetChannelList or dvbManager.GetChannelInfo.

Current DVB type is set via dvb_type bootloader environment variable with the following values:

  • DVB-C
  • DVB-T
  • DVB-T2
  • DVB-S2

Status codes table:

Value Description
0 operation successful
1 error
2 unsupported
3 need reboot
0x1c bad handle

Possible events:

event 40 (0x28) "DVB progress"

When scan starts to search new frequency, player will trigger event 40 (0x28) with the following event data:

{
"state": "searching",
"channel": 23,
"frequency": 650000,
"progress": 33,
"inputIndex": 0,
"polarization": "H"
}

where

Name Description
state scan state: "searching" or "finished"
channel channel number in frequency grid
frequency channel frequency (in kHz)
progress scan progress in range [0..100]
inputIndex antenna (input connector) index [0..n]
polarization optional satellite signal polarization ("V" - vertical, "H" - horizontal, "CL" - circular left, "CR" - circular right ) to tune to

event 41 (0x29) "DVB channel found"

When any new channels is found, player will trigger event 41 (0x29) with the following event data:

{
"id": "C_4601_634000",
"name": "channel_name",
"frequency": 634000,
"inputIndex": 0,
"polarization": "H",
"symbolRate": 27500000
}

where

Name Description
id channel unique identifier
type DVB signal type (see dvbManager.signalType)
name channel name
frequency channel frequency (in kHz)
inputIndex antenna (input connector) index [0..n]
polarization optional satellite signal polarization ("V" - vertical, "H" - horizontal, "CL" - circular left, "CR" - circular right ) to tune to
symbolRate optional satellite/cable signal symbol rate (symbols per second)

event 43 (0x2B) "Power overload"

When antenna power is enabled but antenna is not active then antenna power will be disabled
and event 43 (0x2B) will be triggered to notify JavaScript API user. Example:

{
    "inputIndex": 0
}

where

Name Description
inputIndex antenna (input connector) index [0..n]

Methods

(static) GetAntennaPower(inputIndex) → {boolean}

See:

Get whether antenna power from STB is enabled.

See dvbManager.SetAntennaPower.

Parameters:
Name Type Description
inputIndex number

antenna (input connector) index [0..n]

Returns:

possible values:

Value Description
true power is enabled
false power is disabled
Type
boolean

(static) GetBitErrorRate(inputIndex) → {number}

See:

Get Bit Error Rate.

Parameters:
Name Type Description
inputIndex number

antenna (input connector) index [0..n]

Returns:

(Bit Error Rate) * 10^7

Type
number

(static) GetChannelList(inputIndex) → {dvbManager.typeChannelInfoList}

See:

Get full list of DVB channels in JSON format.

See dvbManager.typeChannelInfo, dvbManager.typeChannelInfoList.

Parameters:
Name Type Description
inputIndex number

antenna (input connector) index [0..n]

Returns:

list of channels descriptions in JSON format

Type
dvbManager.typeChannelInfoList

(static) GetChannelInfo(id) → {dvbManager.typeChannelInfo}

See:

Get information about specified channel in JSON format.

See dvbManager.typeChannelInfo.

Parameters:
Name Type Description
id string

channel unique identifier from dvbManager.GetChannelList

Returns:

channel description in JSON format

Type
dvbManager.typeChannelInfo

(static) ClearChannelList(inputIndex) → {number}

See:

Clear DVB channel list.

Parameters:
Name Type Description
inputIndex number

antenna (input connector) index [0..n]

Returns:

operation status

(see status codes table)

Type
number

(static) RemoveChannel(id) → {number}

See:

Remove specified DVB channel.

Parameters:
Name Type Description
id string

channel unique identifier from dvbManager.GetChannelList

Returns:

operation status

(see status codes table)

Type
number

(static) StartChannelScan(type, inputIndex) → {number}

See:

Start channel scanning.

During scan player can trigger 2 events.

See dvbManager.

Parameters:
Name Type Description
type dvbManager.signalType

DVB signal type

inputIndex number

antenna (input connector) index [0..n]

Returns:

operation status

(see status codes table)

Type
number

(static) StartChannelScanManual(from, to, type, bandwidth, step, inputIndex) → {number}

See:

Start manual channel scanning.

During scan player can trigger 2 events.

See dvbManager, dvbManager.signalType.

Parameters:
Name Type Description
from number

scan range start frequency (in kHz)

to number

scan range end frequency (in kHz)

type dvbManager.signalType

DVB signal type

bandwidth number

channel bandwidth in MHz. e.i. 6, 7, 8

step number

frequency step (in kHz)

inputIndex number

antenna (input connector) index [0..n]

Returns:

operation status

(see status codes table)

Type
number

(static) StopChannelScan(inputIndex) → {number}

See:

Stop channel scan.

Parameters:
Name Type Description
inputIndex number

antenna (input connector) index [0..n]

Returns:

operation status

(see status codes table)

Type
number

(static) GetSignalLevel(inputIndex) → {number}

See:

Get signal level.

Parameters:
Name Type Description
inputIndex number

antenna (input connector) index [0..n]

Returns:

signal level [0..100]

Type
number

(static) GetSignalQuality(inputIndex) → {number}

See:

Get signal quality.

Parameters:
Name Type Description
inputIndex number

antenna (input connector) index [0..n]

Returns:

signal quality [0..100]

Type
number

(static) TuneChannel(config) → {number}

See:

Tune receiver to specified frequency.

See dvbManager.signalType.

Parameters:
Name Type Description
config string

configuration object in JSON format

Name Type Description
inputIndex number antenna (input connector) index [0..n]
frequency number channel frequency (in kHz)
polarization string optional satellite signal polarization ("V" - vertical, "H" - horizontal, "CL" - circular left, "CR" - circular right ) to tune to
symbolRate number satellite/cable signal symbol rate (symbols per second)
type number DVB signal type (see dvbManager.signalType)
Returns:

operation status

(see status codes table)

Type
number

(static) UnTuneChannel(inputIndex) → {number}

See:

Untune receiver from frequency.

Parameters:
Name Type Description
inputIndex number

antenna (input connector) index [0..n]

Returns:

operation status

(see status codes table)

Type
number

(static) SetAntennaPower(on, inputIndex) → {number}

See:

Enable or disable antenna power from STB.

Used to supply power to active antenna.

In case when connected antenna is not active an event 33 (0x2B) will be triggered and antenna power will be disabled.

See dvbManager.

Parameters:
Name Type Description
on boolean

power state

inputIndex number

antenna (input connector) index [0..n]

Returns:

operation status

(see status codes table)

Type
number

(static) SetScanParams(params) → {number}

See:

Set params for DVB channel scan.

Modulation values list:

Value Description
0 AUTO
1 16QAM
2 32QAM
3 64QAM
4 128QAM
5 256QAM
Example
dvbManager.SetScanParams(JSON.stringify({
    type: 1,
    symRate: 6875,
    modulation: 4,
    scanMode: 1,
    frequency: 506000,
    inputIndex: 0,
    networkId: 3333
}));
Parameters:
Name Type Description
params string

configuration object in JSON format

Name Type Description
type number DVB signal type (see dvbManager.signalType)
symbolRate number optional satellite/cable signal symbol rate (symbols per second)
modulation number see modulation values list
scanMode number 0 - network, 1 - full, 2 - fast (use NIT)
frequency number frequency for fast scan (in kHz)
inputIndex number optional antenna (input connector) index [0..n]
networkId number network ID (0 - auto)
Returns:

operation status

(see status codes table)

Type
number

(static) GetSupportedScanTypes(inputIndex) → {string}

See:

Get supported scan types for this STB.

See dvbManager.signalType.

Example
// parsed JSON data
JSON.parse(dvbManager.GetSupportedScanTypes());
// execution result
[
    {type: 1, name: "DVB-C"},
    {type: 2, name: "DVB-T"},
    {type: 3, name: "DVB-T2"}
]
Parameters:
Name Type Description
inputIndex number

antenna (input connector) index [0..n]

Returns:

scan types list in JSON format

Type
string

(static) SetPreferredLang(lang1, lang2, inputIndex) → {number}

See:

Set preferred language for DVB subsystem (EPG etc.).

Example
dvbManager.SetPreferredLang('eng', 'en', 0);
Parameters:
Name Type Description
lang1 string

preferred language in ISO 639-2 format (Alpha-3 code)

lang2 string

preferred language in ISO 639-1 format (Alpha-2 code)

inputIndex number

antenna (input connector) index [0..n]

Returns:

operation status

(see status codes table)

Type
number

(static) GetCurrentScanTypes(inputIndex) → {string}

See:

Get currently supported scan types for this STB.

The difference with dvbManager.GetSupportedScanTypes is:
result of dvbManager.GetCurrentScanTypes depends on current DVB Type
e.i. for MAG275 it can be either DVB-C or DVB-T and DVB-T2, for MAG356 it can be DVB-S2.

See dvbManager.signalType.

Example
// parsed JSON data
JSON.parse(dvbManager.GetCurrentScanTypes());
// execution result
[
    {type: 1, name: "DVB-C"},
    {type: 2, name: "DVB-T"},
    {type: 3, name: "DVB-T2"}
]
Parameters:
Name Type Description
inputIndex number

antenna (input connector) index [0..n]

Returns:

scan types list in JSON format

Type
string

(static) EnableEPG(state)

Enable/disable EPG data collection (enabled by default).

Parameters:
Name Type Description
state number

activity state (0 - turn off, 1 - turn on)

(static) GetEPGBrief(id) → {epgManager.typeInfoList}

Get brief EPG (present and following program) for specified channel.

Parameters:
Name Type Description
id string

channel unique identifier from dvbManager.GetChannelList

Returns:

EPG brief data in JSON format

Type
epgManager.typeInfoList

(static) GetEPGSchedule(id, day) → {epgManager.typeInfoList}

Get schedule EPG (for long period) for specified channel of the selected day.

Parameters:
Name Type Description
id string

channel unique identifier from dvbManager.GetChannelList

day number

selected day number from current day

Returns:

schedule EPG data in JSON format

Type
epgManager.typeInfoList

(static) GetEPGScheduleByRange(id, start, end) → {epgManager.typeInfoList}

Get full EPG (program schedule) for specified channel within specified time range.

Example
var schedule = JSON.parse(epgManager.getScheduleByRange('C_4601_634000', 1428307972, 142832946));
Parameters:
Name Type Description
id string

channel unique identifier from dvbManager.GetChannelList

start number

range start in seconds since epoch

end number

range end in seconds since epoch

Returns:

schedule EPG data in JSON format

Type
epgManager.typeInfoList

Type Definitions

signalType

DVB signal type.

Value Description
1 DVB-C signal
2 DVB-T signal
3 DVB-T2 signal (not available for MAG270)
4 DVB-S2 signal
Type:
  • number

typeChannelInfoList

Properties:
Name Type Description
channels Array.<dvbManager.typeChannelInfo>

individual channels data

List of DVB channels data in JSON format.

See dvbManager.typeChannelInfo.

Type:
  • string
Example
// parsed JSON data
{
    channels: [{
        frequency: 634000,
        inputIndex: 0,
        polarization: "H",
        symbolRate: 27500000,
        id: "C_4601_634000",
        type: 2,
        scrambled: "false",
        name: "ServiceName",
        provider: "testProvider",
        isRadio: "false",
        channel_number: "23"
    }]
}

typeChannelInfo

Properties:
Name Type Attributes Description
frequency number

channel frequency (in kHz)

inputIndex number

antenna (input connector) index [0..n]

polarization string <optional>

satellite signal polarization ("V" - vertical, "H" - horizontal, "CL" - circular left, "CR" - circular right ) to tune to

symbolRate number <optional>

satellite/cable signal symbol rate (symbols per second)

id string

unique channel identifier

type number

DVB signal type (see dvbManager.signalType)

scrambled boolean

scrambled channel indication

name string

channel name

provider string

service provider name

isRadio boolean

radio channel indicator

channel_number string

logical channel number in network (0 means that logical channel number is not found)

Information about a channel in JSON format.

See dvbManager.typeChannelInfoList.

Type:
  • string
Example
// parsed JSON data
{
    frequency: 634000,
    inputIndex: 0,
    polarization: "H",
    symbolRate: 27500000,
    id: "C_4601_634000",
    type: 2,
    scrambled: "false",
    name: "ServiceName",
    provider: "testProvider",
    isRadio: "false",
    channel_number: "23"
}