diff options
author | hayati ayguen <h_ayguen@web.de> | 2017-06-11 00:18:53 +0200 |
---|---|---|
committer | Steve Markgraf <steve@steve-m.de> | 2017-06-13 01:20:32 +0200 |
commit | 18bf26989c926a5db4fca29e7d859af42af1437c (patch) | |
tree | 54a1fa41103e733bc02cfbae2a03f5747418a73e /src/rtl_power.c | |
parent | fa3a113b77b6ed2738778a52ae4f9ce4e6f18ea3 (diff) |
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>
Diffstat (limited to 'src/rtl_power.c')
-rw-r--r-- | src/rtl_power.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/rtl_power.c b/src/rtl_power.c index aa7a138..00f4d9f 100644 --- a/src/rtl_power.c +++ b/src/rtl_power.c @@ -133,6 +133,7 @@ void usage(void) "\t[-d device_index (default: 0)]\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" @@ -771,6 +772,7 @@ int main(int argc, char **argv) int single = 0; int direct_sampling = 0; int offset_tuning = 0; + int enable_biastee = 0; double crop = 0.0; char *freq_optarg; time_t next_tick; @@ -781,7 +783,7 @@ int main(int argc, char **argv) double (*window_fn)(int, int) = rectangle; freq_optarg = ""; - while ((opt = getopt(argc, argv, "f:i:s:t:d:g:p:e:w:c:F:1PDOh")) != -1) { + while ((opt = getopt(argc, argv, "f:i:s:t:d:g:p:e:w:c:F:1PDOhT")) != -1) { switch (opt) { case 'f': // lower:upper:bin_size freq_optarg = strdup(optarg); @@ -849,6 +851,9 @@ int main(int argc, char **argv) boxcar = 0; comp_fir_size = atoi(optarg); break; + case 'T': + enable_biastee = 1; + break; case 'h': default: usage(); @@ -925,6 +930,10 @@ int main(int argc, char **argv) verbose_ppm_set(dev, ppm_error); + rtlsdr_set_bias_tee(dev, enable_biastee); + if (enable_biastee) + fprintf(stderr, "activated bias-T on GPIO PIN 0\n"); + if (strcmp(filename, "-") == 0) { /* Write log to stdout */ file = stdout; #ifdef _WIN32 |