|
|
@ -78,6 +78,7 @@ typedef struct { /* structure size must be multiple of 2 bytes */ |
|
|
|
|
|
|
|
|
|
|
|
static rtlsdr_dev_t *dev = NULL; |
|
|
|
static rtlsdr_dev_t *dev = NULL; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static int enable_biastee = 0; |
|
|
|
static int global_numq = 0; |
|
|
|
static int global_numq = 0; |
|
|
|
static struct llist *ll_buffers = 0; |
|
|
|
static struct llist *ll_buffers = 0; |
|
|
|
static int llbuf_num = 500; |
|
|
|
static int llbuf_num = 500; |
|
|
@ -95,7 +96,8 @@ void usage(void) |
|
|
|
"\t[-b number of buffers (default: 15, set by library)]\n" |
|
|
|
"\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[-n max number of linked list buffers to keep (default: 500)]\n" |
|
|
|
"\t[-d device index (default: 0)]\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); |
|
|
|
exit(1); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -395,7 +397,7 @@ int main(int argc, char **argv) |
|
|
|
struct sigaction sigact, sigign; |
|
|
|
struct sigaction sigact, sigign; |
|
|
|
#endif |
|
|
|
#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) { |
|
|
|
switch (opt) { |
|
|
|
case 'd': |
|
|
|
case 'd': |
|
|
|
dev_index = verbose_device_search(optarg); |
|
|
|
dev_index = verbose_device_search(optarg); |
|
|
@ -425,6 +427,9 @@ int main(int argc, char **argv) |
|
|
|
case 'P': |
|
|
|
case 'P': |
|
|
|
ppm_error = atoi(optarg); |
|
|
|
ppm_error = atoi(optarg); |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
case 'T': |
|
|
|
|
|
|
|
enable_biastee = 1; |
|
|
|
|
|
|
|
break; |
|
|
|
default: |
|
|
|
default: |
|
|
|
usage(); |
|
|
|
usage(); |
|
|
|
break; |
|
|
|
break; |
|
|
@ -495,6 +500,10 @@ int main(int argc, char **argv) |
|
|
|
fprintf(stderr, "Tuner gain set to %f dB.\n", gain/10.0); |
|
|
|
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) */ |
|
|
|
/* Reset endpoint before we start reading from it (mandatory) */ |
|
|
|
r = rtlsdr_reset_buffer(dev); |
|
|
|
r = rtlsdr_reset_buffer(dev); |
|
|
|
if (r < 0) |
|
|
|
if (r < 0) |
|
|
|