• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2011-2014 - Mauro Carvalho Chehab
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License as published by
6  * the Free Software Foundation version 2.1 of the License.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11  * GNU Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16  * Or, point your browser to http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
17  */
18 #ifndef _LIBSAT_H
19 #define _LIBSAT_H
20 
21 #include "dvb-v5-std.h"
22 
23 /**
24  * @file dvb-sat.h
25  * @ingroup satellite
26  * @brief Provides interfaces to deal with DVB Satellite systems.
27  * @copyright GNU Lesser General Public License version 2.1 (LGPLv2.1)
28  * @author Mauro Carvalho Chehab
29  *
30  * @par Bug Report
31  * Please submit bug reports and patches to linux-media@vger.kernel.org
32  */
33 
34 /*
35  * Satellite handling functions
36  */
37 
38 /**
39  * @struct dvb_sat_lnb
40  * @brief Stores the information of a LNBf
41  * @ingroup satellite
42  *
43  * @param name		long name of the LNBf type
44  * @param alias		short name for the LNBf type
45  *
46  * The LNBf (low-noise block downconverter) is a type of amplifier that is
47  * installed inside the parabolic dishes. It converts the antenna signal to
48  * an Intermediate Frequency. Several Ku-band LNBf have more than one IF.
49  * The lower IF is stored at lowfreq, the higher IF at highfreq.
50  * The exact setup for those structs actually depend on the model of the LNBf,
51  * and its usage.
52  */
53 struct dvb_sat_lnb {
54 	const char *name;
55 	const char *alias;
56 
57 	/*
58 	 * Legacy fields, kept just to avoid ABI breakages
59 	 * Should not be used by new applications
60 	 */
61 	unsigned lowfreq, highfreq;
62 	unsigned rangeswitch;
63 	struct dvbsat_freqrange {
64 		unsigned low, high;
65 	} freqrange[2];
66 };
67 
68 struct dvb_v5_fe_parms;
69 
70 #ifdef __cplusplus
71 extern "C" {
72 #endif
73 
74 /* From libsat.c */
75 
76 /**
77  * @brief search for a LNBf entry
78  * @ingroup satellite
79  *
80  * @param name	name of the LNBf entry to seek.
81  *
82  * On sucess, it returns a non-negative number with corresponds to the LNBf
83  * entry inside the LNBf structure at dvb-sat.c.
84  *
85  * @return A -1 return code indicates that the LNBf was not found.
86  */
87 int dvb_sat_search_lnb(const char *name);
88 
89 /**
90  * @brief prints the contents of a LNBf entry at STDOUT.
91  * @ingroup satellite
92  *
93  * @param index		index for the entry
94  *
95  * @return returns -1 if the index is out of range, zero otherwise.
96  */
97 int dvb_print_lnb(int index);
98 
99 /**
100  * @brief Prints all LNBf entries at STDOUT.
101  * @ingroup satellite
102  *
103  * This function doesn't return anything. Internally, it calls dvb_print_lnb()
104  * for all entries inside its LNBf database.
105  */
106 void dvb_print_all_lnb(void);
107 
108 /**
109  * @brief gets a LNBf entry at its internal database
110  * @ingroup satellite
111  *
112  * @param index		index for the entry.
113  *
114  * @return returns NULL if not found, of a struct dvb_sat_lnb pointer otherwise.
115  *
116  * NOTE: none of the strings are i18n translated. In order to get the
117  * translated name, you should use dvb_sat_get_lnb_name()
118  */
119 const struct dvb_sat_lnb *dvb_sat_get_lnb(int index);
120 
121 /**
122  * @brief gets a LNBf entry at its internal database
123  * @ingroup satellite
124  *
125  * @param index		index for the entry.
126  *
127  * @return returns NULL if not found, of the name of a LNBf,
128  * translated to the user language, if translation is available.
129  */
130 const char *dvb_sat_get_lnb_name(int index);
131 
132 /**
133  * @brief sets the satellite parameters
134  * @ingroup satellite
135  *
136  * @param parms	struct dvb_v5_fe_parms pointer.
137  *
138  * This function is called internally by the library to set the LNBf
139  * parameters, if the dvb_v5_fe_parms::lnb field is filled.
140  *
141  * @return 0 on success.
142  */
143 int dvb_sat_set_parms(struct dvb_v5_fe_parms *parms);
144 
145 /**
146  * @brief return the real satellite frequency
147  * @ingroup satellite
148  *
149  * @param p	struct dvb_v5_fe_parms pointer.
150  * @param freq	the DTV frequency.
151  *
152  * This function is called internally by the library to get the satellite
153  * frequency, considering the LO frequency.
154  *
155  * @return frequency.
156  */
157 int dvb_sat_real_freq(struct dvb_v5_fe_parms *p, int freq);
158 
159 
160 #ifdef __cplusplus
161 }
162 #endif
163 
164 #endif // _LIBSAT_H
165