aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2020-06-13 09:08:03 +0200
committerAndreas Eversberg <jolly@eversberg.eu>2020-10-29 07:38:19 +0100
commit79e11d54a666e0e8a934eff70100224c13c72a1b (patch)
treea0024b8542645d9e2c604b1c2622e0a3697762f5
parent2c82b8399309703ecc1ad1f0642a19c974ddf87d (diff)
Add option (global flag) to disable use of SDR
This is required for channels that do not belog to actual radio transceivers.
-rw-r--r--src/libmobile/main_mobile.c17
-rw-r--r--src/libmobile/main_mobile.h1
2 files changed, 13 insertions, 5 deletions
diff --git a/src/libmobile/main_mobile.c b/src/libmobile/main_mobile.c
index 2ae7bf7..0a7b679 100644
--- a/src/libmobile/main_mobile.c
+++ b/src/libmobile/main_mobile.c
@@ -53,6 +53,7 @@ int num_kanal = 0;
const char *kanal[MAX_SENDER];
int num_audiodev = 0;
const char *audiodev[MAX_SENDER] = { "hw:0,0" };
+int allow_sdr = 1;
int use_sdr = 0;
static const char *call_audiodev = "";
int samplerate = 48000;
@@ -158,11 +159,13 @@ void main_mobile_print_help(const char *arg0, const char *ext_usage)
printf(" --read-tx-wave <file>\n");
printf(" Replace transmitted audio by given wave file.\n");
#ifdef HAVE_SDR
+ if (allow_sdr) {
printf(" --limesdr\n");
printf(" Auto-select several required options for LimeSDR\n");
printf(" --limesdr-mini\n");
printf(" Auto-select several required options for LimeSDR Mini\n");
sdr_config_print_help();
+ }
#endif
printf("\nNetwork specific options:\n");
}
@@ -176,7 +179,9 @@ void main_mobile_print_hotkeys(void)
printf("Press 'c' key to toggle display of channel status.\n");
printf("Press 'm' key to toggle display of measurement value.\n");
#ifdef HAVE_SDR
+ if (allow_sdr) {
sdr_config_print_hotkeys();
+ }
#endif
}
@@ -332,7 +337,7 @@ int main_mobile_handle_options(int short_option, int argi, char **argv)
break;
#ifdef HAVE_SDR
case OPT_LIMESDR:
- {
+ if (allow_sdr) {
char *argv_lime[] = { argv[0],
"--sdr-soapy",
"--sdr-rx-antenna", "LNAL",
@@ -345,8 +350,9 @@ int main_mobile_handle_options(int short_option, int argi, char **argv)
int argc_lime = sizeof(argv_lime) / sizeof (*argv_lime);
return options_command_line(argc_lime, argv_lime, main_mobile_handle_options);
}
+ break;
case OPT_LIMESDR_MINI:
- {
+ if (allow_sdr) {
char *argv_lime[] = { argv[0],
"--sdr-soapy",
"--sdr-rx-antenna", "LNAW",
@@ -360,13 +366,14 @@ int main_mobile_handle_options(int short_option, int argi, char **argv)
int argc_lime = sizeof(argv_lime) / sizeof (*argv_lime);
return options_command_line(argc_lime, argv_lime, main_mobile_handle_options);
}
+ break;
#endif
default:
#ifdef HAVE_SDR
- return sdr_config_handle_options(short_option, argi, argv);
-#else
- return -EINVAL;
+ if (allow_sdr)
+ return sdr_config_handle_options(short_option, argi, argv);
#endif
+ return -EINVAL;
}
return 1;
diff --git a/src/libmobile/main_mobile.h b/src/libmobile/main_mobile.h
index aa6625c..ccfa35f 100644
--- a/src/libmobile/main_mobile.h
+++ b/src/libmobile/main_mobile.h
@@ -4,6 +4,7 @@ extern const char *kanal[];
extern int swap_links;
extern int num_audiodev;
extern const char *audiodev[];
+extern int allow_sdr;
extern int use_sdr;
extern int samplerate;
extern int interval;