Add option (global flag) to disable check of channel numbers at sender.c

This is required for channels that do not belog to actual radio transceivers.
pull/1/head
Andreas Eversberg 3 years ago
parent 79e11d54a6
commit 49c4793106
  1. 3
      src/libmobile/sender.c
  2. 2
      src/libmobile/sender.h

@ -35,6 +35,7 @@
sender_t *sender_head = NULL;
static sender_t **sender_tailp = &sender_head;
int cant_recover = 0;
int check_channel = 1;
/* Init transceiver instance and link to list of transceivers. */
int sender_create(sender_t *sender, const char *kanal, double sendefrequenz, double empfangsfrequenz, const char *audiodev, int use_sdr, int samplerate, double rx_gain, int pre_emphasis, int de_emphasis, const char *write_rx_wave, const char *write_tx_wave, const char *read_rx_wave, const char *read_tx_wave, int loopback, enum paging_signal paging_signal)
@ -80,7 +81,7 @@ int sender_create(sender_t *sender, const char *kanal, double sendefrequenz, dou
rc = -EIO;
goto error;
}
if (abs(atoi(master->kanal) - atoi(kanal)) == 1) {
if (check_channel && abs(atoi(master->kanal) - atoi(kanal)) == 1) {
PDEBUG(DSENDER, DEBUG_NOTICE, "------------------------------------------------------------------------\n");
PDEBUG(DSENDER, DEBUG_NOTICE, "NOTE: Channel %s is next to channel %s. This will cause interferences.\n", kanal, master->kanal);
PDEBUG(DSENDER, DEBUG_NOTICE, "Please use at least one channel distance to avoid that.\n");

@ -88,9 +88,9 @@ typedef struct sender {
dispmeas_t dispmeas; /* display measurements */
} sender_t;
/* list of all senders */
extern sender_t *sender_head;
extern int cant_recover;
extern int check_channel;
int sender_create(sender_t *sender, const char *kanal, double sendefrequenz, double empfangsfrequenz, const char *audiodev, int use_sdr, int samplerate, double rx_gain, int pre_emphasis, int de_emphasis, const char *write_rx_wave, const char *write_tx_wave, const char *read_rx_wave, const char *read_tx_wave, int loopback, enum paging_signal paging_signal);
void sender_destroy(sender_t *sender);

Loading…
Cancel
Save