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
Error codes table:
Value | Description |
---|---|
0 | operation successful |
1 | error |
2 | unsupported |
0x1c | bad handle |
Possible events:
event 40 (0x28) "DVB progress"
When any new channels is found, player will trigger event 40 (0x28)
with the following event data:
{"id": "C_4601_634000", "name": "channel_name", "frequency": 634000, "frontendIndex": 0, "polarization": "H", "symbolRate": 27500000}
where
Name | Description |
---|---|
id | channel unique identifier |
name | channel name |
frequency | channel frequency (in kHz) |
frontendIndex | index of satellite frontend (tuner) to be used [0..n] |
polarization | satellite signal polarization ("V " - vertical, "H " - horizontal, "CL " - circular left, "CR " - circular right ) to tune to |
symbolRate | satellite signal symbol rate (symbols per second) |
event 41 (0x29) "DVB channel found"
When scan starts to search new frequency, player will trigger event 41 (0x29)
with the following event data:
{"state": "searching", "channel": 23, "frequency": 650000, "progress": 33, "frontendIndex": 0, "polarization": "H", "symbolRate": 27500000}"
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] |
frontendIndex | index of satellite frontend (tuner) to be used [0..n] |
polarization | satellite signal polarization ("V " - vertical, "H " - horizontal, "CL " - circular left, "CR " - circular right ) to tune to |
symbolRate | satellite signal symbol rate (symbols per second) |
event 42 (0x2A) "EPG updated"
When new EPG is found, player will trigger event 42 (0x2A)
with the following event data:
{"id": "C_4601_634000", "brief": false}
where
Name | Description |
---|---|
id | channel unique identifier which EPG is updated |
brief | true - brief EPG is updated, false - schedule EPG is updated |
See dvbManager.GetEPGBrief and dvbManager.GetEPGSchedule.
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:
{"frontendIndex": 0}
where
Name | Description |
---|---|
frontendIndex | index of satellite frontend (tuner) to be used [0..n] |
Methods
-
ClearChannelList
<static> ClearChannelList () → {number} -
Clear DVB channel list.
Returns:Type Description number
operation status
(see error codes table)
-
ClearChannelList
<static> ClearChannelList ( config ) → {number} -
Clear DVB channel list.
Supports DVB-S2.
Parameters:Name Type Description config
string
configuration object in JSON format
Name Description frontendIndex index of satellite frontend (tuner) to be used [0..n] Returns:Type Description number
operation status
(see error codes table)
-
GetAntennaPower
<static> GetAntennaPower () → {boolean} -
Get whether antenna power from STB is enabled.
Returns:Type Description boolean
possible values:
Value Description true power is enabled false power is disabled -
GetAntennaPower
<static> GetAntennaPower ( config ) → {boolean} -
Parameters:
Name Type Description config
string
configuration object in JSON format
Name Description frontendIndex index of satellite frontend (tuner) to be used [0..n] Returns:Type Description boolean
possible values:
Value Description true power is enabled false power is disabled -
GetBitErrorRate
<static> GetBitErrorRate () → {number} -
Get Bit Error Rate.
Returns:Type Description number
(Bit Error Rate) * 10^7
-
GetBitErrorRate
<static> GetBitErrorRate ( config ) → {number} -
Get Bit Error Rate.
Supports DVB-S2.
Parameters:Name Type Description config
string
configuration object in JSON format
Name Description frontendIndex index of satellite frontend (tuner) to be used [0..n] Returns:Type Description number
(Bit Error Rate) * 10^7
-
GetChannelInfo
<static> GetChannelInfo ( config ) → {dvbManager.ChannelInfo} -
Get information about specified channel in JSON format.
Supports DVB-S2.
Parameters:Name Type Description config
string
configuration object in JSON format
Name Description frontendIndex index of satellite frontend (tuner) to be used [0..n] id channel unique identifier from dvbManager.GetChannelList Returns:Type Description channel description in JSON format
-
GetChannelInfo
<static> GetChannelInfo ( id ) → {dvbManager.ChannelInfo} -
Get information about specified channel in JSON format.
Parameters:Name Type Description id
string
channel unique identifier from dvbManager.GetChannelList
Returns:Type Description channel description in JSON format
-
GetChannelList
<static> GetChannelList ( config ) → {dvbManager.ChannelInfoList} -
Get full list of DVB channels in JSON format.
Supports DVB-S2.
Parameters:Name Type Description config
string
configuration object in JSON format
Name Description frontendIndex index of satellite frontend (tuner) to be used [0..n] Returns:Type Description list of channels descriptions in JSON format
-
GetChannelList
<static> GetChannelList () → {dvbManager.ChannelInfoList} -
Get full list of DVB channels in JSON format.
Returns:Type Description list of channels descriptions in JSON format
-
GetCurrentScanTypes
<static> GetCurrentScanTypes () → {string} -
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.
Returns:Type Description string
scan types list in JSON format
Examples
// raw data dvbManager.GetCurrentScanTypes(); // execution result '[{"type":1,"name":"DVB-C"},{"type":2,"name":"DVB-T"},{"type":3,"name":"DVB-T2"}]'
// parsed JSON data JSON.parse(dvbManager.GetCurrentScanTypes()); // execution result [ {type: 1, name: "DVB-C"}, {type: 2, name: "DVB-T"}, {type: 3, name: "DVB-T2"} ]
-
GetCurrentScanTypes
<static> GetCurrentScanTypes ( config ) → {string} -
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.
Supports DVB-S2.
Parameters:Name Type Description config
string
configuration object in JSON format
Name Description frontendIndex index of satellite frontend (tuner) to be used [0..n] Returns:Type Description string
scan types list in JSON format
Examples
// raw data dvbManager.GetCurrentScanTypes(JSON.stringify({frontendIndex:1})); // execution result '[{"type":1,"name":"DVB-C"},{"type":2,"name":"DVB-T"},{"type":3,"name":"DVB-T2"}, {"type":4,"name":"DVB-S2"}]'
// parsed JSON data JSON.parse(dvbManager.GetCurrentScanTypes(JSON.stringify({frontendIndex:1}))); // execution result [ {type: 1, name: "DVB-C"}, {type: 2, name: "DVB-T"}, {type: 3, name: "DVB-T2"}, {type: 4, name: "DVB-S2"} ]
-
GetEPGBrief
<static> GetEPGBrief ( id ) → {dvbManager.EpgInfoList} -
Get brief EPG (present and following program) for specified channel.
Parameters:Name Type Description id
string
channel unique identifier from dvbManager.GetChannelList
Returns:Type Description EPG brief in JSON format
-
GetEPGBrief
<static> GetEPGBrief ( config ) → {dvbManager.EpgInfoList} -
Get brief EPG (present and following program) for specified channel.
Supports DVB-S2.
Parameters:Name Type Description config
string
configuration object in JSON format
Name Description frontendIndex index of satellite frontend (tuner) to be used [0..n] id channel unique identifier from dvbManager.GetChannelList Returns:Type Description EPG brief in JSON format
-
GetEPGSchedule
<static> GetEPGSchedule ( id, day ) → {dvbManager.EpgInfoList} -
Get schedule EPG (for long period) for specified channel.
Parameters:Name Type Argument Default Description id
string
channel unique identifier from dvbManager.GetChannelList
day
number
<optional>
-1
number of days from current day which should be available in result
(-1 means full schedule EPG)
Returns:Type Description schedule EPG in JSON format
-
GetEPGSchedule
<static> GetEPGSchedule ( config ) → {dvbManager.EpgInfoList} -
Get schedule EPG (for long period) for specified channel.
Supports DVB-S2.
Parameters:Name Type Description config
string
configuration object in JSON format
Name Description frontendIndex index of satellite frontend (tuner) to be used [0..n] id channel unique identifier from dvbManager.GetChannelList day number of days from current day which should be available in result (-1 means full schedule EPG) Returns:Type Description schedule EPG in JSON format
-
GetSignalLevel
<static> GetSignalLevel ( config ) → {number} -
Get signal level.
Supports DVB-S2.
Parameters:Name Type Description config
string
configuration object in JSON format
Name Description frontendIndex index of satellite frontend (tuner) to be used [0..n] Returns:Type Description number
signal level [0..100]
-
GetSignalLevel
<static> GetSignalLevel () → {number} -
Get signal level.
Returns:Type Description number
signal level [0..100]
-
GetSignalQuality
<static> GetSignalQuality () → {number} -
Get signal quality.
Returns:Type Description number
signal quality [0..100]
-
GetSignalQuality
<static> GetSignalQuality ( config ) → {number} -
Get signal quality.
Supports DVB-S2.
Parameters:Name Type Description config
string
configuration object in JSON format
Name Description frontendIndex index of satellite frontend (tuner) to be used [0..n] Returns:Type Description number
signal quality [0..100]
-
GetSupportedScanTypes
<static> GetSupportedScanTypes () → {string} -
Get supported scan types for this STB.
Returns:Type Description string
scan types list in JSON format
Examples
// raw data dvbManager.GetSupportedScanTypes(); // execution result '[{"type":1,"name":"DVB-C"},{"type":2,"name":"DVB-T"},{"type":3,"name":"DVB-T2"}]'
// parsed JSON data JSON.parse(dvbManager.GetSupportedScanTypes()); // execution result [ {type: 1, name: "DVB-C"}, {type: 2, name: "DVB-T"}, {type: 3, name: "DVB-T2"} ]
-
GetSupportedScanTypes
<static> GetSupportedScanTypes ( config ) → {string} -
Parameters:
Name Type Description config
string
configuration object in JSON format
Name Description frontendIndex index of satellite frontend (tuner) to be used [0..n] Returns:Type Description string
scan types list in JSON format
Examples
// raw data dvbManager.GetSupportedScanTypes(JSON.stringify({frontendIndex:1})); // execution result '[{"type":1,"name":"DVB-C"},{"type":2,"name":"DVB-T"},{"type":3,"name":"DVB-T2"},{"type":4,"name":"DVB-S2"}]'
// parsed JSON data JSON.parse(dvbManager.GetSupportedScanTypes(JSON.stringify({frontendIndex:1}))); // execution result [ {type: 1, name: "DVB-C"}, {type: 2, name: "DVB-T"}, {type: 3, name: "DVB-T2"} {type: 4, name: "DVB-S2"} ]
-
RemoveChannel
<static> RemoveChannel ( id ) → {number} -
Remove specified DVB channel.
Parameters:Name Type Description id
string
channel unique identifier from dvbManager.GetChannelList
Returns:Type Description number
operation status
(see error codes table)
-
RemoveChannel
<static> RemoveChannel ( config ) → {number} -
Remove specified DVB channel.
Supports DVB-S2.
Parameters:Name Type Description config
string
configuration object in JSON format
Name Description frontendIndex index of satellite frontend (tuner) to be used [0..n] id channel unique identifier from dvbManager.GetChannelList Returns:Type Description number
operation status
(see error codes table)
-
SetAntennaPower
<static> SetAntennaPower ( config ) → {number} -
Enable or disable antenna power from STB.
Used for DVB-T/T2/S2 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.Supports DVB-S2.
See dvbManager.
Parameters:Name Type Description config
string
configuration object in JSON format
Name Description frontendIndex index of satellite frontend (tuner) to be used [0..n] on state Returns:Type Description number
operation status
(see error codes table)
-
SetAntennaPower
<static> SetAntennaPower ( on ) → {number} -
Enable or disable antenna power from STB.
Used for DVB-T/T2 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
Returns:Type Description number
operation status
(see error codes table)
-
SetPreferredLang
<static> SetPreferredLang ( config ) → {number} -
Set preferred language for DVB subsystem (EPG etc.).
Supports DVB-S2.
Parameters:Name Type Description config
string
configuration object in JSON format
Name Description frontendIndex index of satellite frontend (tuner) to be used [0..n] lang1 preferred language in ISO 639-2 format (Alpha-3 code) lang2 preferred language in ISO 639-1 format (Alpha-2 code) Returns:Type Description number
operation status
(see error codes table)
Example
dvbManager.SetPreferredLang(JSON.stringify({frontendIndex:1, lang1: 'eng', lang2: 'en'}));
-
SetPreferredLang
<static> SetPreferredLang ( lang1, lang2 ) → {number} -
Set preferred language for DVB subsystem (EPG etc.).
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)
Returns:Type Description number
operation status
(see error codes table)
Example
dvbManager.SetPreferredLang('eng', 'en');
-
SetScanParams
<static> SetScanParams ( params ) → {number} -
Set params for DVB channel scan.
Modulation values list:
Value Description 0 AUTO 1 16QAM 2 32QAM 3 64QAM 4 128QAM 5 256QAM Supports DVB-S2.
Parameters:Name Type Description params
string
configuration object in JSON format
Name Description type dvb signal type (see dvbManager.signalType) symRate symbolRate in Kb/sec modulation see modulation values list scanMode 0 - network, 1 - full, 2 - fast (use NIT) frequency frequency for fast scan in KHz frontendIndex optional index of satellite frontend (tuner) to be used [0..n] networkId network ID (0 - auto) Returns:Type Description number
operation status
(see error codes table)
Example
dvbManager.SetScanParams(JSON.stringify({ type: 1, symRate: 6875, modulation: 4, scanMode: 1, frequency: 506000, frontendIndex: 0, networkId: 3333 }));
-
StartChannelScan
<static> StartChannelScan ( type ) → {number} -
Parameters:
Name Type Description type
dvb signal type
Returns:Type Description number
operation status
(see error codes table)
-
StartChannelScan
<static> StartChannelScan ( config ) → {number} -
Parameters:
Name Type Description config
string
configuration object in JSON format
Name Description frontendIndex index of satellite frontend (tuner) to be used [0..n] type dvb signal type (see dvbManager.signalType) Returns:Type Description number
operation status
(see error codes table)
-
StartChannelScanManual
<static> StartChannelScanManual ( from, to, type, bandwidth, step ) → {number} -
Start manual channel scanning.
During scan player can trigger 2 events.
Parameters:Name Type Description from
number
scan range start frequency (in kHz)
to
number
scan range end frequency (in kHz)
type
dvb signal type
bandwidth
number
channel bandwidth in MHz. e.i. 6, 7, 8
step
number
frequency step (in kHz)
Returns:Type Description number
operation status
(see error codes table)
-
StartChannelScanManual
<static> StartChannelScanManual ( config ) → {number} -
Start manual channel scanning.
During scan player can trigger 2 events.
Supports DVB-S2.
Parameters:Name Type Description config
string
configuration object in JSON format
Name Description frontendIndex index of satellite frontend (tuner) to be used [0..n] type dvb signal type (see dvbManager.signalType) from scan range start frequency (in kHz) to scan range end frequency (in kHz) bandwidth channel bandwidth in MHz. e.i. 6, 7, 8 step frequency step (in kHz) Returns:Type Description number
operation status
(see error codes table)
-
StopChannelScan
<static> StopChannelScan () → {number} -
Stop channel scan.
Returns:Type Description number
operation status
(see error codes table)
-
StopChannelScan
<static> StopChannelScan ( config ) → {number} -
Stop channel scan.
Supports DVB-S2.
Parameters:Name Type Description config
string
configuration object in JSON format
Name Description frontendIndex index of satellite frontend (tuner) to be used [0..n] Returns:Type Description number
operation status
(see error codes table)
-
TuneChannel
<static> TuneChannel ( config ) → {number} -
Parameters:
Name Type Description config
string
configuration object in JSON format
Name Description frontendIndex index of satellite frontend (tuner) to be used [0..n] id channel unique identifier from dvbManager.GetChannelList type dvb signal type (see dvbManager.signalType) Returns:Type Description number
operation status
(see error codes table)
-
TuneChannel
<static> TuneChannel ( frequency, type ) → {number} -
Tune receiver to specified frequency.
Parameters:Name Type Description frequency
number
frequency (in kHz)
type
dvb signal type
Returns:Type Description number
operation status
(see error codes table)
-
UnTuneChannel
<static> UnTuneChannel () → {number} -
Untune receiver from frequency.
Returns:Type Description number
operation status
(see error codes table)
-
UnTuneChannel
<static> UnTuneChannel ( config ) → {number} -
Untune receiver from frequency.
Supports DVB-S2.
Parameters:Name Type Description config
string
configuration object in JSON format
Name Description frontendIndex index of satellite frontend (tuner) to be used [0..n] Returns:Type Description number
operation status
(see error codes table)
Type Definitions
-
ChannelInfo
ChannelInfo -
Information about a channel in JSON format.
Type:-
string
Properties:Name Type Description frequency
number
channel frequency (in kHz)
frontendIndex
number
index of satellite frontend (tuner) to be used [0..n]
polarization
string
satellite signal polarization ("
V
" - vertical, "H
" - horizontal, "CL
" - circular left, "CR
" - circular right ) to tune tosymbolRate
number
satellite signal symbol rate (symbols per second)
id
string
unique channel identifier
scrambled
boolean
scrambled channel indication
name
string
channel name
provider
string
service provider name
isRadio
boolean
radio channel indicator
channel_number
number
logical channel number in network (0 means that logical channel number is not found)
Example
// parsed JSON data { frequency: 634000, frontendIndex: 0, polarization: "H", symbolRate: 27500000, id: "C_4601_634000", scrambled: "false", name: "ServiceName", provider: "testProvider", isRadio: "false", channel_number: 23 }
-
-
ChannelInfoList
ChannelInfoList -
List of DVB channels data in JSON format.
Type:-
string
Properties:Name Type Description channels
Array.<dvbManager.ChannelInfo>
individual channels data
Example
// parsed JSON data { channels: [{ frequency: 634000, frontendIndex: 0, polarization: "H", symbolRate: 27500000, id: "C_4601_634000", scrambled: "false", name: "ServiceName", provider: "testProvider", isRadio: "false", channel_number: 23 }] }
-
-
EpgInfo
EpgInfo -
Brief EPG (present and following program) for specified channel in JSON format.
Type:-
string
Properties:Name Type Description start
number
event start time in UTC seconds
duration
number
event duration in seconds
name
string
event name
info
string
event info
details
string
detailed event info
Example
// parsed JSON data { start: 1377846480, duration: 3300, name: "Program1_name", info: "program1_info", details: "program1_details" }
-
-
EpgInfoList
EpgInfoList -
List of brief EPG (present and following program) in JSON format.
See dvbManager.EpgInfo.
Type:-
string
Properties:Name Type Description events
Array.<dvbManager.EpgInfo>
EPG data
Example
// parsed JSON data { events: [ { start: 1377846480, duration: 3300, name:"Program1_name", info:"program1_info", details:"program1_details" }, { start: 1377846480, duration: 3300, name:"Program1_name", info:"program1_info", details:"program1_details" } ] }
-
-
signalType
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
-