Update rtl_tcp.c

Added -X switch to enable RTL AGC in CLI for those apps that doesn't support turning RTL AGC on.
pull/15/head
michelinok 2015-03-24 16:10:04 +01:00
rodzic c14354bcc8
commit aa6949bc2f
1 zmienionych plików z 15 dodań i 2 usunięć

Wyświetl plik

@ -95,7 +95,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[-X enable RTL AGC]\n");
exit(1);
}
@ -369,6 +370,7 @@ int main(int argc, char **argv)
int dev_index = 0;
int dev_given = 0;
int gain = 0;
int rtlagc = 0;
int ppm_error = 0;
int custom_ppm = 0;
struct llist *curelem,*prev;
@ -388,12 +390,15 @@ 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:X")) != -1) {
switch (opt) {
case 'd':
dev_index = verbose_device_search(optarg);
dev_given = 1;
break;
case 'X':
rtlagc = 0;
break;
case 'f':
frequency = (uint32_t)atofs(optarg);
break;
@ -473,6 +478,14 @@ int main(int argc, char **argv)
else
fprintf(stderr, "Tuned to %i Hz.\n", frequency);
/* enable RTL_AGC */
if (!rtlagc) {
fprintf(stderr,"Enabling RTL AGC\n");
verbose_set_rtlagc(dev);
}
if (0 == gain) {
/* Enable automatic gain */
r = rtlsdr_set_tuner_gain_mode(dev, 0);