Allow giving alphanumeric channels (Prepare for IMTS)
This commit is contained in:
@@ -37,7 +37,7 @@ static sender_t **sender_tailp = &sender_head;
|
||||
int cant_recover = 0;
|
||||
|
||||
/* Init transceiver instance and link to list of transceivers. */
|
||||
int sender_create(sender_t *sender, int 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)
|
||||
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)
|
||||
{
|
||||
sender_t *master, *slave;
|
||||
int rc = 0;
|
||||
@@ -75,14 +75,14 @@ int sender_create(sender_t *sender, int kanal, double sendefrequenz, double empf
|
||||
* of the master channel.
|
||||
*/
|
||||
for (master = sender_head; master; master = master->next) {
|
||||
if (master->kanal == kanal) {
|
||||
PDEBUG(DSENDER, DEBUG_ERROR, "Channel %d may not be defined for multiple transceivers!\n", kanal);
|
||||
if (!strcmp(master->kanal, kanal)) {
|
||||
PDEBUG(DSENDER, DEBUG_ERROR, "Channel %s may not be defined for multiple transceivers!\n", kanal);
|
||||
rc = -EIO;
|
||||
goto error;
|
||||
}
|
||||
if (abs(master->kanal - kanal) == 1) {
|
||||
if (abs(atoi(master->kanal) - atoi(kanal)) == 1) {
|
||||
PDEBUG(DSENDER, DEBUG_NOTICE, "------------------------------------------------------------------------\n");
|
||||
PDEBUG(DSENDER, DEBUG_NOTICE, "NOTE: Channel %d is next to channel %d. This will cause interferences.\n", kanal, master->kanal);
|
||||
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");
|
||||
PDEBUG(DSENDER, DEBUG_NOTICE, "------------------------------------------------------------------------\n");
|
||||
}
|
||||
@@ -91,12 +91,12 @@ int sender_create(sender_t *sender, int kanal, double sendefrequenz, double empf
|
||||
}
|
||||
if (master) {
|
||||
if (master->paging_signal != PAGING_SIGNAL_NONE && !use_sdr) {
|
||||
PDEBUG(DSENDER, DEBUG_ERROR, "Cannot share audio device with channel %d, because its second audio channel is used for paging signal! Use different audio device.\n", master->kanal);
|
||||
PDEBUG(DSENDER, DEBUG_ERROR, "Cannot share audio device with channel %s, because its second audio channel is used for paging signal! Use different audio device.\n", master->kanal);
|
||||
rc = -EBUSY;
|
||||
goto error;
|
||||
}
|
||||
if (paging_signal != PAGING_SIGNAL_NONE && !use_sdr) {
|
||||
PDEBUG(DSENDER, DEBUG_ERROR, "Cannot share audio device with channel %d, because we need a second audio channel for paging signal! Use different audio device.\n", master->kanal);
|
||||
PDEBUG(DSENDER, DEBUG_ERROR, "Cannot share audio device with channel %s, because we need a second audio channel for paging signal! Use different audio device.\n", master->kanal);
|
||||
rc = -EBUSY;
|
||||
goto error;
|
||||
}
|
||||
|
Reference in New Issue
Block a user