aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorrtlsdrblog <admin@rtl-sdr.com>2023-08-23 22:40:21 +1200
committerSteve Markgraf <steve@steve-m.de>2023-11-02 12:28:51 +0100
commit6de0987c3df5879489e60f50f83727e6fd9e3fae (patch)
tree25c5305c251883a2c7a5426773f520743a06c7c4 /src
parent138cd052f5345990507de630001421dc49937b20 (diff)
add -D direct sampling flag to rtl_tcp
Diffstat (limited to 'src')
-rw-r--r--src/rtl_tcp.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/rtl_tcp.c b/src/rtl_tcp.c
index 3ed0cae..4316cc4 100644
--- a/src/rtl_tcp.c
+++ b/src/rtl_tcp.c
@@ -105,6 +105,7 @@ void usage(void)
printf("\t[-d device index (default: 0)]\n");
printf("\t[-P ppm_error (default: 0)]\n");
printf("\t[-T enable bias-T on GPIO PIN 0 (works for rtl-sdr.com v3 dongles)]\n");
+ printf("\t[-D enable direct sampling (default: off)]\n");
exit(1);
}
@@ -396,6 +397,7 @@ int main(int argc, char **argv)
int dev_given = 0;
int gain = 0;
int ppm_error = 0;
+ int direct_sampling = 0;
struct llist *curelem,*prev;
pthread_attr_t attr;
void *status;
@@ -413,7 +415,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:T")) != -1) {
+ while ((opt = getopt(argc, argv, "a:p:f:g:s:b:n:d:P:TD")) != -1) {
switch (opt) {
case 'd':
dev_index = verbose_device_search(optarg);
@@ -446,6 +448,9 @@ int main(int argc, char **argv)
case 'T':
enable_biastee = 1;
break;
+ case 'D':
+ direct_sampling = 1;
+ break;
default:
usage();
break;
@@ -482,6 +487,11 @@ int main(int argc, char **argv)
SetConsoleCtrlHandler( (PHANDLER_ROUTINE) sighandler, TRUE );
#endif
+ /* Set direct sampling */
+ if (direct_sampling) {
+ verbose_direct_sampling(dev, 2);
+ }
+
/* Set the tuner error */
verbose_ppm_set(dev, ppm_error);