Channel id

Module API help / support section for programmers.

Moderators: FredB, X05, Dreamer

fredx21
Not too shy to talk
Posts: 18
Joined: Wed Feb 20, 2008 10:22 am

Channel id

Postby fredx21 » Mon Jun 07, 2010 4:00 am

I'd like to know where the TChannelInfo.dwChId comes from. Is it a sequential number generated by DVBDream or is it received from the sat to uniquely identify channels?

Fred

Skywalker-1, Skywalker-2, W7.
DVBLink for DVBDream author.
User avatar
rel
relocation
Posts: 1999
Joined: Fri Jun 16, 2006 9:50 am

Postby rel » Mon Jun 07, 2010 7:01 am

it is simply the index in the CHL structure Channels array.
first is 0 last is 7999 (check in SDK documentation)

not generated or not DVB related.



it is stated in "CHL File Format.txt" :
--------------------------------------------------

CHL File Format
----------------

A CHL file has a fixed size (4.181.466 bytes) as it can hold limited number
of channels (max. 8000 channels)

File consist of following 4 sections:

Offset Section
-------- -----------
00000000 : Header (26 bytes)
0000001A : Satellites (8320 bytes)
0000209A : Favorites (5120 bytes)
0000349A : Channels (4168000 bytes)


Max number of items that CHL file can hold are below
- Satellites: 64
- Favorites: 64
- Channels: 8000
- Audio PIDs per channel: 16
- CA PIDs per channel: 64



Detailed info about the sections can be found in header files for the
following compilers

C/C++ = moduleapi.h
Delphi = moduleapi.pas
Assembly = moduleapi.inc

* chbase.pas includes CHL helper functions for Delphi.



NOTES:
1) If dwFreq (in the TChlChannel) is 0,
wPos (in the TChlSat) is 0,
FavName (in the TChlFav) is 0
it means that entry in the array is not used (or is empty)
2) Favorites stored as "favid+1" in TChlChannel structure
3) In an empty CHL all the bytes must be 0, except the header section as
it holds the sign and version info
4) Following line shows how Channel-ID that is used in ModuleAPI functions
is calculated:
CHID = Offset(in the array) / sizeof(TChlChannel)

5) Following line shows how Fav-ID is calculated:
FAVID = Offset(in the array) / sizeof(TChlFav)
6) Satellite position info stored in SatCoDX 4 digit sat-code format
(19.2° East = 0192 or 110 ° West = 2500)
West positions calculated as 360 - angle
DVB Dream - because I have to dream about having time to code it
fredx21
Not too shy to talk
Posts: 18
Joined: Wed Feb 20, 2008 10:22 am

Postby fredx21 » Mon Jun 07, 2010 7:23 am

thanks for the reply rel.

Can I use the channel Id to permanently identify a channel, scan after scan, even if the channel is updated or other channels are added/deleted?
Skywalker-1, Skywalker-2, W7.

DVBLink for DVBDream author.
User avatar
rel
relocation
Posts: 1999
Joined: Fri Jun 16, 2006 9:50 am

Postby rel » Mon Jun 07, 2010 7:29 am

fredx21 wrote:thanks for the reply rel.

Can I use the channel Id to permanently identify a channel, scan after scan, even if the channel is updated or other channels are added/deleted?


yea.
updates and other new/deleted channels won't change the ID. unless the channel itself is deleted and scanned again.
DVB Dream - because I have to dream about having time to code it

Return to “Module / Plugin Programming”

Who is online

Users browsing this forum: No registered users and 1 guest