mirror of
https://github.com/DigitalDevices/dddvb.git
synced 2023-10-10 13:37:43 +02:00
add source and verbosity
This commit is contained in:
parent
5d1fdcb961
commit
36e3205574
22
lib/ddzap.c
22
lib/ddzap.c
@ -24,7 +24,8 @@ int main(int argc, char **argv)
|
|||||||
struct dddvb_fe *fe;
|
struct dddvb_fe *fe;
|
||||||
struct dddvb_params p;
|
struct dddvb_params p;
|
||||||
uint32_t bandwidth = 8000000, frequency = 0, symbol_rate = 0, pol = DDDVB_UNDEF;
|
uint32_t bandwidth = 8000000, frequency = 0, symbol_rate = 0, pol = DDDVB_UNDEF;
|
||||||
uint32_t id = DDDVB_UNDEF, pls = DDDVB_UNDEF, num = DDDVB_UNDEF;
|
uint32_t id = DDDVB_UNDEF, pls = DDDVB_UNDEF, num = DDDVB_UNDEF, source = 0;
|
||||||
|
uint32_t verbosity = 0;
|
||||||
enum fe_code_rate fec = FEC_AUTO;
|
enum fe_code_rate fec = FEC_AUTO;
|
||||||
enum fe_delivery_system delsys = ~0;
|
enum fe_delivery_system delsys = ~0;
|
||||||
char *config = "config/";
|
char *config = "config/";
|
||||||
@ -38,16 +39,18 @@ int main(int argc, char **argv)
|
|||||||
{"frequency", required_argument, 0, 'f'},
|
{"frequency", required_argument, 0, 'f'},
|
||||||
{"bandwidth", required_argument, 0, 'b'},
|
{"bandwidth", required_argument, 0, 'b'},
|
||||||
{"symbolrate", required_argument, 0, 's'},
|
{"symbolrate", required_argument, 0, 's'},
|
||||||
|
{"source", required_argument, 0, 'l'},
|
||||||
{"delsys", required_argument, 0, 'd'},
|
{"delsys", required_argument, 0, 'd'},
|
||||||
{"id", required_argument, 0, 'i'},
|
{"id", required_argument, 0, 'i'},
|
||||||
{"pls", required_argument, 0, 'g'},
|
{"pls", required_argument, 0, 'g'},
|
||||||
{"root", required_argument, 0, 'r'},
|
{"root", required_argument, 0, 'r'},
|
||||||
{"num", required_argument, 0, 'n'},
|
{"num", required_argument, 0, 'n'},
|
||||||
|
{"verbosity", required_argument, 0, 'v'},
|
||||||
{"help", no_argument , 0, 'h'},
|
{"help", no_argument , 0, 'h'},
|
||||||
{0, 0, 0, 0}
|
{0, 0, 0, 0}
|
||||||
};
|
};
|
||||||
c = getopt_long(argc, argv,
|
c = getopt_long(argc, argv,
|
||||||
"c:i:f:s:d:p:hg:r:n:b:",
|
"c:i:f:s:d:p:hg:r:n:b:l:v:",
|
||||||
long_options, &option_index);
|
long_options, &option_index);
|
||||||
if (c==-1)
|
if (c==-1)
|
||||||
break;
|
break;
|
||||||
@ -65,6 +68,12 @@ int main(int argc, char **argv)
|
|||||||
case 's':
|
case 's':
|
||||||
symbol_rate = strtoul(optarg, NULL, 0);
|
symbol_rate = strtoul(optarg, NULL, 0);
|
||||||
break;
|
break;
|
||||||
|
case 'l':
|
||||||
|
source = strtoul(optarg, NULL, 0);
|
||||||
|
break;
|
||||||
|
case 'v':
|
||||||
|
verbosity = strtoul(optarg, NULL, 0);
|
||||||
|
break;
|
||||||
case 'g':
|
case 'g':
|
||||||
pls = strtoul(optarg, NULL, 0);
|
pls = strtoul(optarg, NULL, 0);
|
||||||
break;
|
break;
|
||||||
@ -131,7 +140,7 @@ int main(int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
dd = dddvb_init(config, 0);//0xffff);
|
dd = dddvb_init(config, verbosity);
|
||||||
if (!dd) {
|
if (!dd) {
|
||||||
printf("dddvb_init failed\n");
|
printf("dddvb_init failed\n");
|
||||||
exit(-1);
|
exit(-1);
|
||||||
@ -148,6 +157,7 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
dddvb_param_init(&p);
|
dddvb_param_init(&p);
|
||||||
dddvb_set_frequency(&p, frequency);
|
dddvb_set_frequency(&p, frequency);
|
||||||
|
dddvb_set_src(&p, source);
|
||||||
dddvb_set_bandwidth(&p, bandwidth);
|
dddvb_set_bandwidth(&p, bandwidth);
|
||||||
dddvb_set_symbol_rate(&p, symbol_rate);
|
dddvb_set_symbol_rate(&p, symbol_rate);
|
||||||
dddvb_set_polarization(&p, pol);
|
dddvb_set_polarization(&p, pol);
|
||||||
@ -155,6 +165,12 @@ int main(int argc, char **argv)
|
|||||||
dddvb_set_id(&p, id);
|
dddvb_set_id(&p, id);
|
||||||
dddvb_set_pls(&p, pls);
|
dddvb_set_pls(&p, pls);
|
||||||
dddvb_dvb_tune(fe, &p);
|
dddvb_dvb_tune(fe, &p);
|
||||||
|
{
|
||||||
|
uint8_t ts[188];
|
||||||
|
|
||||||
|
dddvb_ca_write(dd, 0, ts, 188);
|
||||||
|
|
||||||
|
}
|
||||||
while (1) {
|
while (1) {
|
||||||
fe_status_t stat;
|
fe_status_t stat;
|
||||||
int64_t str, cnr;
|
int64_t str, cnr;
|
||||||
|
Loading…
Reference in New Issue
Block a user