aboutsummaryrefslogtreecommitdiffstats
path: root/src/rtl_tcp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/rtl_tcp.c')
-rw-r--r--src/rtl_tcp.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/rtl_tcp.c b/src/rtl_tcp.c
index aef120e..da6057b 100644
--- a/src/rtl_tcp.c
+++ b/src/rtl_tcp.c
@@ -78,6 +78,7 @@ typedef struct { /* structure size must be multiple of 2 bytes */
static rtlsdr_dev_t *dev = NULL;
+static int enable_biastee = 0;
static int global_numq = 0;
static struct llist *ll_buffers = 0;
static int llbuf_num = 500;
@@ -95,7 +96,8 @@ void usage(void)
"\t[-b number of buffers (default: 15, set by library)]\n"
"\t[-n max number of linked list buffers to keep (default: 500)]\n"
"\t[-d device index (default: 0)]\n"
- "\t[-P ppm_error (default: 0)]\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");
exit(1);
}
@@ -395,7 +397,7 @@ int main(int argc, char **argv)
struct sigaction sigact, sigign;
#endif
- while ((opt = getopt(argc, argv, "a:p:f:g:s:b:n:d:P:")) != -1) {
+ while ((opt = getopt(argc, argv, "a:p:f:g:s:b:n:d:P:T")) != -1) {
switch (opt) {
case 'd':
dev_index = verbose_device_search(optarg);
@@ -425,6 +427,9 @@ int main(int argc, char **argv)
case 'P':
ppm_error = atoi(optarg);
break;
+ case 'T':
+ enable_biastee = 1;
+ break;
default:
usage();
break;
@@ -495,6 +500,10 @@ int main(int argc, char **argv)
fprintf(stderr, "Tuner gain set to %f dB.\n", gain/10.0);
}
+ 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) */
r = rtlsdr_reset_buffer(dev);
if (r < 0)