struct dvb_v5_stats stats;
/* Satellite specific stuff, specified by the library client */
- struct dvb_satellite_lnb *lnb;
+ struct dvbsat_lnb *lnb;
int sat_number;
unsigned freq_bpf;
/* Satellite specific stuff, used internally */
- enum polarization pol;
+ enum dvbsat_polarization pol;
int high_band;
unsigned diseqc_wait;
unsigned freq_offset;
char *location;
- enum polarization pol;
+ enum dvbsat_polarization pol;
int sat_number;
unsigned freq_bpf;
unsigned diseqc_wait;
struct dvb_descriptors;
+#ifdef __cplusplus
+extern "C" {
+#endif
+
static inline void dvb_file_free(struct dvb_file *dvb_file)
{
struct dvb_entry *entry = dvb_file->first_entry, *next;
int get_detected, int get_nit);
int parse_delsys(const char *name);
enum file_formats parse_format(const char *name);
-struct dvb_file *read_file_format(const char *fname,
+struct dvb_file *dvb_read_file_format(const char *fname,
uint32_t delsys,
enum file_formats format);
int write_file_format(const char *fname,
uint32_t delsys,
enum file_formats format);
+#ifdef __cplusplus
+}
#endif
+
+#endif // _DVB_FILE_H
PILOT_AUTO,
} fe_pilot_t;
-typedef enum fe_rolloff {
+typedef enum fe_rolloff { // FIXME: move to libsat.h ?
ROLLOFF_35, /* Implied value in DVB-S, default for DVB-S2 */
ROLLOFF_20,
ROLLOFF_25,
#ifndef _LIBSAT_H
#define _LIBSAT_H
-enum polarization {
+enum dvbsat_polarization {
POLARIZATION_OFF = 0,
POLARIZATION_H = 1,
POLARIZATION_V = 2,
POLARIZATION_R = 4,
};
-struct dvb_satellite_freqrange {
+struct dvbsat_freqrange {
unsigned low, high;
};
-struct dvb_satellite_lnb {
+struct dvbsat_lnb {
char *name;
char *alias;
unsigned lowfreq, highfreq;
unsigned rangeswitch;
- struct dvb_satellite_freqrange freqrange[2];
+ struct dvbsat_freqrange freqrange[2];
};
-struct dvb_v5_fe_parms *parms;
+struct dvb_v5_fe_parms;
+
+extern const char *dvbsat_polarization_name[5];
+
+#ifdef __cplusplus
+extern "C" {
+#endif
/* From libsat.c */
int search_lnb(char *name);
int print_lnb(int i);
void print_all_lnb(void);
-struct dvb_satellite_lnb *get_lnb(int i);
+struct dvbsat_lnb *get_lnb(int i);
int dvb_satellite_set_parms(struct dvb_v5_fe_parms *parms);
int dvb_satellite_get_parms(struct dvb_v5_fe_parms *parms);
+#ifdef __cplusplus
+}
#endif
+
+#endif // _LIBSAT_H
return -1;
}
-struct dvb_file *read_file_format(const char *fname,
+struct dvb_file *dvb_read_file_format(const char *fname,
uint32_t delsys,
enum file_formats format)
{
#include "dvb-fe.h"
-struct dvb_satellite_lnb lnb[] = {
+struct dvbsat_lnb lnb[] = {
{
.name = "Europe",
.alias = "UNIVERSAL",
}
}
-struct dvb_satellite_lnb *get_lnb(int i)
+struct dvbsat_lnb *get_lnb(int i)
{
if (i >= ARRAY_SIZE(lnb))
return NULL;
cmd->address = diseqc_addr[type];
}
+struct dvb_v5_fe_parms *parms; // legacy code, used for parms->fd, FIXME anyway
+
/* Inputs are numbered from 1 to 16, according with the spec */
static int dvbsat_diseqc_write_to_port_group(struct diseqc_cmd *cmd,
int high_band,
static int dvbsat_diseqc_set_input(struct dvb_v5_fe_parms *parms, uint16_t t)
{
int rc;
- enum polarization pol = parms->pol;
+ enum dvbsat_polarization pol = parms->pol;
int pol_v = (pol == POLARIZATION_V) || (pol == POLARIZATION_R);
int high_band = parms->high_band;
int sat_number = parms->sat_number;
int dvb_satellite_set_parms(struct dvb_v5_fe_parms *parms)
{
- struct dvb_satellite_lnb *lnb = parms->lnb;
- enum polarization pol = parms->pol;
+ struct dvbsat_lnb *lnb = parms->lnb;
+ enum dvbsat_polarization pol = parms->pol;
uint32_t freq;
uint16_t t = 0;
uint32_t voltage = SEC_VOLTAGE_13;
return 0;
}
+
+const char *dvbsat_polarization_name[5] = {
+ "OFF",
+ "H",
+ "V",
+ "L",
+ "R",
+};
printf("Reading file %s\n", args->input_file);
- dvb_file = read_file_format(args->input_file, args->delsys,
+ dvb_file = dvb_read_file_format(args->input_file, args->delsys,
args->input_format);
if (!dvb_file) {
fprintf(stderr, "Error reading file %s\n", args->input_file);
static int new_freq_is_needed(struct dvb_entry *entry,
struct dvb_entry *last_entry,
uint32_t freq,
- enum polarization pol,
+ enum dvbsat_polarization pol,
int shift)
{
int i;
{
int i;
uint32_t freq, shift = 0;
- enum polarization pol = POLARIZATION_OFF;
+ enum dvbsat_polarization pol = POLARIZATION_OFF;
if (!dvb_desc->nit_table.frequency)
return;
sys = SYS_UNDEFINED;
break;
}
- dvb_file = read_file_format(args->confname, sys,
+ dvb_file = dvb_read_file_format(args->confname, sys,
args->input_format);
if (!dvb_file)
return -2;
if (verbose)
fprintf(stderr, "using demux '%s'\n", args.demux_dev);
- parms = dvb_fe_open(args.adapter, args.frontend, verbose, 0);
+ struct dvb_v5_fe_parms *parms = dvb_fe_open(args.adapter, args.frontend, verbose, 0);
if (!parms)
return -1;
if (lnb >= 0)
sys = SYS_UNDEFINED;
break;
}
- dvb_file = read_file_format(args->confname, sys,
+ dvb_file = dvb_read_file_format(args->confname, sys,
args->input_format);
if (!dvb_file)
return -2;