mirror of
https://github.com/rtlsdrblog/rtl-sdr-blog.git
synced 2025-07-13 12:55:10 +02:00
Add option '-T' for activating bias-T in rtl_(adsb|fm|power|tcp)
* added debug output when activating Signed-off-by: hayati ayguen <h_ayguen@web.de> * fixed options argument Signed-off-by: Fabian P. Schmidt <kerel-fs@gmx.de> Signed-off-by: Steve Markgraf <steve@steve-m.de>
This commit is contained in:
committed by
Steve Markgraf
parent
fa3a113b77
commit
18bf26989c
@ -96,6 +96,7 @@ void usage(void)
|
||||
"\t[-e allowed_errors (default: 5)]\n"
|
||||
"\t[-g tuner_gain (default: automatic)]\n"
|
||||
"\t[-p ppm_error (default: 0)]\n"
|
||||
"\t[-T enable bias-T on GPIO PIN 0 (works for rtl-sdr.com v3 dongles)]\n"
|
||||
"\tfilename (a '-' dumps samples to stdout)\n"
|
||||
"\t (omitting the filename also uses stdout)\n\n"
|
||||
"Streaming with netcat:\n"
|
||||
@ -371,11 +372,12 @@ int main(int argc, char **argv)
|
||||
int dev_index = 0;
|
||||
int dev_given = 0;
|
||||
int ppm_error = 0;
|
||||
int enable_biastee = 0;
|
||||
pthread_cond_init(&ready, NULL);
|
||||
pthread_mutex_init(&ready_m, NULL);
|
||||
squares_precompute();
|
||||
|
||||
while ((opt = getopt(argc, argv, "d:g:p:e:Q:VS")) != -1)
|
||||
while ((opt = getopt(argc, argv, "d:g:p:e:Q:VST")) != -1)
|
||||
{
|
||||
switch (opt) {
|
||||
case 'd':
|
||||
@ -400,6 +402,9 @@ int main(int argc, char **argv)
|
||||
case 'Q':
|
||||
quality = (int)(atof(optarg) * 10);
|
||||
break;
|
||||
case 'T':
|
||||
enable_biastee = 1;
|
||||
break;
|
||||
default:
|
||||
usage();
|
||||
return 0;
|
||||
@ -470,6 +475,10 @@ int main(int argc, char **argv)
|
||||
/* Set the sample rate */
|
||||
verbose_set_sample_rate(dev, ADSB_RATE);
|
||||
|
||||
rtlsdr_set_bias_tee(dev, enable_biastee);
|
||||
if (enable_biastee)
|
||||
fprintf(stderr, "activated bias-T on GPIO PIN 0\n");
|
||||
|
||||
/* Reset endpoint before we start reading from it (mandatory) */
|
||||
verbose_reset_buffer(dev);
|
||||
|
||||
|
Reference in New Issue
Block a user