aboutsummaryrefslogtreecommitdiffstats
path: root/isdb-t/br-mg-Almenara
blob: 0155428447e6599c4b0665fe4206637a908f1288 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Channel table for Almenara - MG - Brazil
# Source: http://portalbsd.com.br/novo/terrestres_channels.php?channels=591

# Physical channel 23
[Rede Vida]
	DELIVERY_SYSTEM = ISDBT
	BANDWIDTH_HZ = 6000000
	FREQUENCY = 527142857
	INVERSION = AUTO
	GUARD_INTERVAL = AUTO
	TRANSMISSION_MODE = AUTO
	INVERSION = AUTO
	GUARD_INTERVAL = AUTO
	TRANSMISSION_MODE = AUTO
	ISDBT_LAYER_ENABLED = 7
	ISDBT_SOUND_BROADCASTING = 0
	ISDBT_SB_SUBCHANNEL_ID = 0
	ISDBT_SB_SEGMENT_IDX = 0
	ISDBT_SB_SEGMENT_COUNT = 0
	ISDBT_LAYERA_FEC = AUTO
	ISDBT_LAYERA_MODULATION = QAM/AUTO
	ISDBT_LAYERA_SEGMENT_COUNT = 0
	ISDBT_LAYERA_TIME_INTERLEAVING = 0
	ISDBT_LAYERB_FEC = AUTO
	ISDBT_LAYERB_MODULATION = QAM/AUTO
	ISDBT_LAYERB_SEGMENT_COUNT = 0
	ISDBT_LAYERB_TIME_INTERLEAVING = 0
	ISDBT_LAYERC_FEC = AUTO
	ISDBT_LAYERC_MODULATION = QAM/AUTO
	ISDBT_LAYERC_SEGMENT_COUNT = 0
	ISDBT_LAYERC_TIME_INTERLEAVING = 0
{ color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#!/usr/bin/perl -w

use strict;

die "no section perl file given" unless @ARGV;

my $h = require($ARGV[0]);

our $basename;
our $debug = $ARGV[1];

($basename) = $ARGV[0] =~ /([a-zA-Z0-9_\-_]+).pl/;

local *H;
local *C;

h_header();
c_header();

foreach (sort keys %{$h}) {
	foreach my $item (@{$h->{$_}}) {
		if ($_ eq "descriptors") {
			printf H ("#define %s_ID 0x%02X\n",uc($item->{name}),$item->{id});
		}

		do_it  ($item->{name},$item->{elements});
	}
}

h_footer();
c_footer();

sub type
{
	if ($_[0] > 16) {
		return "u32";
	} elsif ($_[0] > 8) {
		return "u16";
	} else {
		return "u8 ";
	}
}

sub do_it
{
	my ($name,$val) = @_;
	print H "struct $name {\n";

	print C <<EOL;
struct $name read_$name(const u8 *b)
{
	struct $name v;
EOL
	my $offs = 0;
	for (my $i = 0; $i < scalar @{$val}; $i+=2) {
		printf H ("\t\t%s %-25s :%2d;\n",type($val->[$i+1]),$val->[$i],$val->[$i+1]);

		printf C ("\tv.%-25s = getBits(b,%3d,%2d);\n",$val->[$i],$offs,$val->[$i+1]);
		printf C ("\tfprintf(stderr,\"  %s = %%x %%d\\n\",v.%s,v.%s);\n",$val->[$i],$val->[$i],$val->[$i]) if $debug;
		$offs += $val->[$i+1];
	}
	print H "} PACKED;\n";
	print H "struct $name read_$name(const u8 *);\n\n";

	print C "\treturn v;\n}\n\n"
}

sub h_header
{
	open(H,">$basename.h");
	print H "#ifndef __".uc($basename)."_H_\n";
	print H "#define __".uc($basename)."_H_\n\n";
	print H "#include \"section.h\"\n\n";
}

sub c_header
{
	open(C,">$basename.c");
	print C "#include \"$basename.h\"\n\n";
}


sub c_footer
{
	close(C);
}

sub h_footer
{
	print H "#endif\n";
	close(H);
}