add datetime mgr
[enigma2.git] / lib / dvb_si / terrestrial_delivery_system_descriptor.cpp
1 /*
2  * $Id: terrestrial_delivery_system_descriptor.cpp,v 1.1 2003-10-17 15:36:38 tmbinc Exp $
3  *
4  * (C) 2003 Andreas Oberritter <obi@saftware.de>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19  *
20  */
21
22 #include <lib/dvb_si/terrestrial_delivery_system_descriptor.h>
23
24 TerrestrialDeliverySystemDescriptor::TerrestrialDeliverySystemDescriptor(const uint8_t * const buffer) : Descriptor(buffer)
25 {
26         centreFrequency = (buffer[2] << 24) | (buffer[3] << 16) | (buffer[4] << 8) | buffer[5];
27         bandwidth = (buffer[6] >> 5) & 0x07;
28         reserved = buffer[6] & 0x1f;
29         constellation = (buffer[7] >> 6) & 0x03;
30         hierarchyInformation = (buffer[7] >> 3) & 0x07;
31         codeRateHpStream = buffer[7] & 0x07;
32         codeRateLpStream = (buffer[8] >> 5) & 0x07;
33         guardInterval = (buffer[8] >> 3) & 0x03;
34         transmissionMode = (buffer[8] >> 1) & 0x03;
35         otherFrequencyFlag = buffer[8] & 0x01;
36         reserved2 = (buffer[9] << 24) | (buffer[10] << 16) | (buffer[11] << 8) | buffer[12];
37 }
38
39 uint32_t TerrestrialDeliverySystemDescriptor::getCentreFrequency(void) const
40 {
41         return centreFrequency;
42 }
43
44 uint8_t TerrestrialDeliverySystemDescriptor::getBandwidth(void) const
45 {
46         return bandwidth;
47 }
48
49 uint8_t TerrestrialDeliverySystemDescriptor::getConstellation(void) const
50 {
51         return constellation;
52 }
53
54 uint8_t TerrestrialDeliverySystemDescriptor::getHierarchyInformation(void) const
55 {
56         return hierarchyInformation;
57 }
58
59 uint8_t TerrestrialDeliverySystemDescriptor::getCodeRateHpStream(void) const
60 {
61         return codeRateHpStream;
62 }
63
64 uint8_t TerrestrialDeliverySystemDescriptor::getCodeRateLpStream(void) const
65 {
66         return codeRateLpStream;
67 }
68
69 uint8_t TerrestrialDeliverySystemDescriptor::getGuardInterval(void) const
70 {
71         return guardInterval;
72 }
73
74 uint8_t TerrestrialDeliverySystemDescriptor::getTransmissionMode(void) const
75 {
76         return transmissionMode;
77 }
78
79 uint8_t TerrestrialDeliverySystemDescriptor::getOtherFrequencyFlag(void) const
80 {
81         return otherFrequencyFlag;
82 }
83