command line extended gain and bandwidth options

development
David 2020-09-19 11:07:11 +09:30
parent 89f758437e
commit b3549df70d
1 changed files with 9 additions and 1 deletions

View File

@ -50,6 +50,7 @@
/* rtlsdr ------------------------------------*/
#define DEFAULT_SAMPLE_RATE 1800000
#define DEFAULT_BANDWIDTH 0 /* automatic bandwidth */
#define DEFAULT_BUF_LENGTH (16 * 16384)
#define MINIMAL_BUF_LENGTH 512
#define MAXIMAL_BUF_LENGTH (256 * 16384)
@ -387,13 +388,14 @@ int main(int argc, char **argv)
int Rs = DEFAULT_SYMBOL_RATE;
int M = DEFAULT_M;
int channel_width = DEFAULT_CHANNEL_WIDTH;
uint32_t bandwidth = DEFAULT_BANDWIDTH;
int tone_spacing = 100;
int freq_est_mask = 0;
output_bits = 1;
int ext_gain = 0;
int gains_hex, lna_gain, mixer_gain, vga_gain;
while ((opt = getopt(argc, argv, "d:f:g:s:b:n:p:S:u:r:m:c:M:R:xt:")) != -1) {
while ((opt = getopt(argc, argv, "d:e:f:g:s:b:n:p:S:u:r:m:c:M:R:xt:w:")) != -1) {
switch (opt) {
case 'd':
dev_index = verbose_device_search(optarg);
@ -414,6 +416,9 @@ int main(int argc, char **argv)
case 's':
samp_rate = (uint32_t)atofs(optarg);
break;
case 'w':
bandwidth = (uint32_t)atofs(optarg);
break;
case 'p':
ppm_error = atoi(optarg);
break;
@ -538,6 +543,9 @@ int main(int argc, char **argv)
/* Set the sample rate */
verbose_set_sample_rate(dev, samp_rate);
/* Set the tuner bandwidth */
verbose_set_bandwidth(dev, bandwidth);
/* Set the frequency */
verbose_set_frequency(dev, frequency);