limesdr: add ability to select RX channel

Add ability to select an RX channel by number. By default channel 0 is
used.

Test: connect LimeSDR device and try to select the RX channel by number:
    OK: $ ./dump1090 --device-type limesdr --limesdr-channel 0
    OK: $ ./dump1090 --device-type limesdr --limesdr-channel 1
    NG: $ ./dump1090 --device-type limesdr --limesdr-channel 2
        $ limesdr: Invalid channel number.

Signed-off-by: Gluttton <gluttton@ukr.net>
This commit is contained in:
Gluttton 2020-07-30 22:44:45 +03:00
parent 7267d8aff9
commit eb476d2e75
1 changed files with 3 additions and 0 deletions

View File

@ -110,6 +110,7 @@ void limesdrShowHelp()
printf("\n"); printf("\n");
printf("--limesdr-verbosity set verbosity level for LimeSDR messages\n"); printf("--limesdr-verbosity set verbosity level for LimeSDR messages\n");
printf("--limesdr-serial serial number of desired device\n"); printf("--limesdr-serial serial number of desired device\n");
printf("--limesdr-channel set number of an RX channel\n");
printf("\n"); printf("\n");
} }
@ -122,6 +123,8 @@ bool limesdrHandleOption(int argc, char **argv, int *jptr)
LimeSDR.verbosity = atoi(argv[++j]); LimeSDR.verbosity = atoi(argv[++j]);
} else if (!strcmp(argv[j], "--limesdr-serial") && more) { } else if (!strcmp(argv[j], "--limesdr-serial") && more) {
strcpy(LimeSDR.serial, argv[++j]); strcpy(LimeSDR.serial, argv[++j]);
} else if (!strcmp(argv[j], "--limesdr-channel") && more) {
LimeSDR.stream.channel = atoi(argv[++j]);
} else { } else {
return false; return false;
} }