dvb-sat.h 4.1 KB

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