aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/amps/amps.c40
-rw-r--r--src/amps/amps.h2
-rw-r--r--src/amps/amps_tacs_main.c6
-rw-r--r--src/anetz/anetz.c16
-rw-r--r--src/anetz/anetz.h2
-rw-r--r--src/anetz/main.c2
-rw-r--r--src/bnetz/bnetz.c32
-rw-r--r--src/bnetz/bnetz.h2
-rw-r--r--src/bnetz/main.c2
-rw-r--r--src/cnetz/cnetz.c56
-rw-r--r--src/cnetz/cnetz.h2
-rw-r--r--src/cnetz/main.c6
-rw-r--r--src/jolly/jolly.c16
-rw-r--r--src/jolly/jolly.h2
-rw-r--r--src/jolly/main.c2
-rw-r--r--src/libdebug/debug.c8
-rw-r--r--src/libdebug/debug.h4
-rw-r--r--src/libdisplay/display.h14
-rw-r--r--src/libdisplay/display_measurements.c4
-rw-r--r--src/libdisplay/display_spectrum.c4
-rw-r--r--src/libdisplay/display_status.c6
-rw-r--r--src/libdisplay/display_wave.c4
-rw-r--r--src/libmobile/main_mobile.c4
-rw-r--r--src/libmobile/main_mobile.h2
-rw-r--r--src/libmobile/sender.c14
-rw-r--r--src/libmobile/sender.h4
-rw-r--r--src/libsquelch/squelch.c6
-rw-r--r--src/libsquelch/squelch.h4
-rw-r--r--src/nmt/main.c8
-rw-r--r--src/nmt/nmt.c50
-rw-r--r--src/nmt/nmt.h2
-rw-r--r--src/r2000/main.c2
-rw-r--r--src/r2000/r2000.c24
-rw-r--r--src/r2000/r2000.h2
34 files changed, 177 insertions, 177 deletions
diff --git a/src/amps/amps.c b/src/amps/amps.c
index 0585823..4206adb 100644
--- a/src/amps/amps.c
+++ b/src/amps/amps.c
@@ -443,7 +443,7 @@ static amps_t *search_channel(int channel)
amps_t *amps;
for (sender = sender_head; sender; sender = sender->next) {
- if (sender->kanal != channel)
+ if (atoi(sender->kanal) != channel)
continue;
amps = (amps_t *) sender;
if (amps->state == STATE_IDLE)
@@ -494,7 +494,7 @@ static amps_t *search_pc(void)
}
/* Create transceiver instance and link to a list. */
-int amps_create(int channel, enum amps_chan_type chan_type, 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, amps_si *si, uint16_t sid, uint8_t sat, int polarity, int tolerant, int loopback)
+int amps_create(const char *kanal, enum amps_chan_type chan_type, 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, amps_si *si, uint16_t sid, uint8_t sat, int polarity, int tolerant, int loopback)
{
sender_t *sender;
amps_t *amps;
@@ -503,8 +503,8 @@ int amps_create(int channel, enum amps_chan_type chan_type, const char *audiodev
const char *band;
/* check for channel number */
- if (amps_channel2freq(channel, 0) == 0) {
- PDEBUG(DAMPS, DEBUG_ERROR, "Channel number %d invalid.\n", channel);
+ if (amps_channel2freq(atoi(kanal), 0) == 0) {
+ PDEBUG(DAMPS, DEBUG_ERROR, "Channel number %s invalid.\n", kanal);
return -EINVAL;
}
@@ -526,23 +526,23 @@ int amps_create(int channel, enum amps_chan_type chan_type, const char *audiodev
}
/* check if channel type matches channel number */
- ct = amps_channel2type(channel);
+ ct = amps_channel2type(atoi(kanal));
if (ct == CHAN_TYPE_CC && chan_type != CHAN_TYPE_PC && chan_type != CHAN_TYPE_CC_PC && chan_type != CHAN_TYPE_CC_PC_VC) {
- PDEBUG(DAMPS, DEBUG_NOTICE, "Channel number %d belongs to a control channel, but your channel type '%s' requires to be on a voice channel number. Some phone may reject this, but all my phones don't.\n", channel, chan_type_long_name(chan_type));
+ PDEBUG(DAMPS, DEBUG_NOTICE, "Channel number %s belongs to a control channel, but your channel type '%s' requires to be on a voice channel number. Some phone may reject this, but all my phones don't.\n", kanal, chan_type_long_name(chan_type));
}
if (ct == CHAN_TYPE_VC && chan_type != CHAN_TYPE_VC) {
- PDEBUG(DAMPS, DEBUG_ERROR, "Channel number %d belongs to a voice channel, but your channel type '%s' requires to be on a control channel number. Please use correct channel.\n", channel, chan_type_long_name(chan_type));
+ PDEBUG(DAMPS, DEBUG_ERROR, "Channel number %s belongs to a voice channel, but your channel type '%s' requires to be on a control channel number. Please use correct channel.\n", kanal, chan_type_long_name(chan_type));
return -EINVAL;
}
/* check if sid machtes channel band */
- band = amps_channel2band(channel);
+ band = amps_channel2band(atoi(kanal));
if (band[0] == 'A' && (sid & 1) == 0 && chan_type != CHAN_TYPE_VC) {
- PDEBUG(DAMPS, DEBUG_ERROR, "Channel number %d belongs to system A, but your %s %d is even and belongs to system B. Please give odd %s.\n", channel, (!tacs) ? "SID" : "AID", sid, (!tacs) ? "SID" : "AID");
+ PDEBUG(DAMPS, DEBUG_ERROR, "Channel number %s belongs to system A, but your %s %d is even and belongs to system B. Please give odd %s.\n", kanal, (!tacs) ? "SID" : "AID", sid, (!tacs) ? "SID" : "AID");
return -EINVAL;
}
if (band[0] == 'B' && (sid & 1) == 1 && chan_type != CHAN_TYPE_VC) {
- PDEBUG(DAMPS, DEBUG_ERROR, "Channel number %d belongs to system B, but your %s %d is odd and belongs to system A. Please give even %s.\n", channel, (!tacs) ? "SID" : "AID", sid, (!tacs) ? "SID" : "AID");
+ PDEBUG(DAMPS, DEBUG_ERROR, "Channel number %s belongs to system B, but your %s %d is odd and belongs to system A. Please give even %s.\n", kanal, (!tacs) ? "SID" : "AID", sid, (!tacs) ? "SID" : "AID");
return -EINVAL;
}
@@ -552,8 +552,8 @@ int amps_create(int channel, enum amps_chan_type chan_type, const char *audiodev
}
/* check if we selected a voice channel that i outside 20 MHz band */
- if (chan_type == CHAN_TYPE_VC && channel > 666) {
- PDEBUG(DAMPS, DEBUG_NOTICE, "You selected '%s' on channel #%d. Older phones do not support channels above #666.\n", chan_type_long_name(chan_type), channel);
+ if (chan_type == CHAN_TYPE_VC && atoi(kanal) > 666) {
+ PDEBUG(DAMPS, DEBUG_NOTICE, "You selected '%s' on channel #%s. Older phones do not support channels above #666.\n", chan_type_long_name(chan_type), kanal);
}
amps = calloc(1, sizeof(amps_t));
@@ -562,10 +562,10 @@ int amps_create(int channel, enum amps_chan_type chan_type, const char *audiodev
return -ENOMEM;
}
- PDEBUG(DAMPS, DEBUG_DEBUG, "Creating 'AMPS' instance for channel = %d of band %s (sample rate %d).\n", channel, band, samplerate);
+ PDEBUG(DAMPS, DEBUG_DEBUG, "Creating 'AMPS' instance for channel = %s of band %s (sample rate %d).\n", kanal, band, samplerate);
/* init general part of transceiver */
- rc = sender_create(&amps->sender, channel, amps_channel2freq(channel, 0), amps_channel2freq(channel, 1), audiodev, use_sdr, samplerate, rx_gain, 0, 0, write_rx_wave, write_tx_wave, read_rx_wave, read_tx_wave, loopback, PAGING_SIGNAL_NONE);
+ rc = sender_create(&amps->sender, kanal, amps_channel2freq(atoi(kanal), 0), amps_channel2freq(atoi(kanal), 1), audiodev, use_sdr, samplerate, rx_gain, 0, 0, write_rx_wave, write_tx_wave, read_rx_wave, read_tx_wave, loopback, PAGING_SIGNAL_NONE);
if (rc < 0) {
PDEBUG(DAMPS, DEBUG_ERROR, "Failed to init transceiver process!\n");
goto error;
@@ -603,7 +603,7 @@ int amps_create(int channel, enum amps_chan_type chan_type, const char *audiodev
// amps_new_state(amps, STATE_BUSY);
#endif
- PDEBUG(DAMPS, DEBUG_NOTICE, "Created channel #%d (System %s) of type '%s' = %s\n", channel, band, chan_type_short_name(chan_type), chan_type_long_name(chan_type));
+ PDEBUG(DAMPS, DEBUG_NOTICE, "Created channel #%s (System %s) of type '%s' = %s\n", kanal, band, chan_type_short_name(chan_type), chan_type_long_name(chan_type));
return 0;
@@ -619,7 +619,7 @@ void amps_destroy(sender_t *sender)
amps_t *amps = (amps_t *) sender;
transaction_t *trans;
- PDEBUG(DAMPS, DEBUG_DEBUG, "Destroying 'AMPS' instance for channel = %d.\n", sender->kanal);
+ PDEBUG(DAMPS, DEBUG_DEBUG, "Destroying 'AMPS' instance for channel = %s.\n", sender->kanal);
while ((trans = amps->trans_list)) {
const char *number = amps_min2number(trans->min1, trans->min2);
@@ -862,7 +862,7 @@ reject:
return;
}
if (!trans) {
- trans = create_transaction(amps, TRANS_CALL_MO_ASSIGN, min1, min2, 0, 0, 0, vc->sender.kanal);
+ trans = create_transaction(amps, TRANS_CALL_MO_ASSIGN, min1, min2, 0, 0, 0, atoi(vc->sender.kanal));
strncpy(trans->dialing, dialing, sizeof(trans->dialing) - 1);
if (!trans) {
PDEBUG(DAMPS, DEBUG_ERROR, "Failed to create transaction\n");
@@ -870,7 +870,7 @@ reject:
}
} else {
trans_new_state(trans, TRANS_CALL_MT_ASSIGN);
- trans->chan = vc->sender.kanal;
+ trans->chan = atoi(vc->sender.kanal);
}
/* if we support DTX and also the phone does, we set DTX state of transaction */
if (amps->si.word2.dtx) {
@@ -1129,9 +1129,9 @@ static amps_t *assign_voice_channel(transaction_t *trans)
}
if (vc == amps)
- PDEBUG(DAMPS, DEBUG_INFO, "Staying on combined control + voice channel %d\n", vc->sender.kanal);
+ PDEBUG(DAMPS, DEBUG_INFO, "Staying on combined control + voice channel %s\n", vc->sender.kanal);
else
- PDEBUG(DAMPS, DEBUG_INFO, "Moving to voice channel %d\n", vc->sender.kanal);
+ PDEBUG(DAMPS, DEBUG_INFO, "Moving to voice channel %s\n", vc->sender.kanal);
/* switch channel... */
timer_start(&trans->timer, SAT_TO1);
diff --git a/src/amps/amps.h b/src/amps/amps.h
index b43caac..0bfcf62 100644
--- a/src/amps/amps.h
+++ b/src/amps/amps.h
@@ -173,7 +173,7 @@ const char *amps_min12number(uint32_t min1);
void amps_number2min(const char *number, uint32_t *min1, uint16_t *min2);
const char *amps_min2number(uint32_t min1, uint16_t min2);
const char *amps_scm(uint8_t scm);
-int amps_create(int channel, enum amps_chan_type chan_type, 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, amps_si *si, uint16_t sid, uint8_t sat, int polarity, int tolerant, int loopback);
+int amps_create(const char *kanal, enum amps_chan_type chan_type, 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, amps_si *si, uint16_t sid, uint8_t sat, int polarity, int tolerant, int loopback);
void amps_destroy(sender_t *sender);
void amps_go_idle(amps_t *amps);
void amps_rx_signaling_tone(amps_t *amps, int tone, double quality);
diff --git a/src/amps/amps_tacs_main.c b/src/amps/amps_tacs_main.c
index d6b0e5a..7edb214 100644
--- a/src/amps/amps_tacs_main.c
+++ b/src/amps/amps_tacs_main.c
@@ -306,7 +306,7 @@ int main_amps_tacs(int argc, char *argv[])
// NOTE: Variable 'i' from above is used here:
/* default SID/AID, depending on system */
if (!sid) {
- if (amps_channel2band(kanal[i])[0] == 'A') {
+ if (amps_channel2band(atoi(kanal[i]))[0] == 'A') {
if (!tacs)
sid = 1; /* Chicago */
else
@@ -387,9 +387,9 @@ int main_amps_tacs(int argc, char *argv[])
goto fail;
}
if (!tacs)
- printf("Base station on channel %d ready (%s), please tune transmitter to %.3f MHz and receiver to %.3f MHz. (%.3f MHz offset)\n", kanal[i], chan_type_long_name(chan_type[i]), amps_channel2freq(kanal[i], 0) / 1e6, amps_channel2freq(kanal[i], 1) / 1e6, amps_channel2freq(kanal[i], 2) / 1e6);
+ printf("Base station on channel %s ready (%s), please tune transmitter to %.3f MHz and receiver to %.3f MHz. (%.3f MHz offset)\n", kanal[i], chan_type_long_name(chan_type[i]), amps_channel2freq(atoi(kanal[i]), 0) / 1e6, amps_channel2freq(atoi(kanal[i]), 1) / 1e6, amps_channel2freq(atoi(kanal[i]), 2) / 1e6);
else
- printf("Base station on channel %d ready (%s), please tune transmitter to %.4f MHz and receiver to %.4f MHz. (%.3f MHz offset)\n", kanal[i], chan_type_long_name(chan_type[i]), amps_channel2freq(kanal[i], 0) / 1e6, amps_channel2freq(kanal[i], 1) / 1e6, amps_channel2freq(kanal[i], 2) / 1e6);
+ printf("Base station on channel %s ready (%s), please tune transmitter to %.4f MHz and receiver to %.4f MHz. (%.3f MHz offset)\n", kanal[i], chan_type_long_name(chan_type[i]), amps_channel2freq(atoi(kanal[i]), 0) / 1e6, amps_channel2freq(atoi(kanal[i]), 1) / 1e6, amps_channel2freq(atoi(kanal[i]), 2) / 1e6);
}
main_mobile(&quit, latency, interval, NULL, station_id, 10);
diff --git a/src/anetz/anetz.c b/src/anetz/anetz.c
index e33aa79..d447377 100644
--- a/src/anetz/anetz.c
+++ b/src/anetz/anetz.c
@@ -186,13 +186,13 @@ static void anetz_timeout(struct timer *timer);
static void anetz_go_idle(anetz_t *anetz);
/* Create transceiver instance and link to a list. */
-int anetz_create(int kanal, const char *audiodev, int use_sdr, int samplerate, double rx_gain, double page_gain, int page_sequence, 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, double squelch_db, const char *operator)
+int anetz_create(const char *kanal, const char *audiodev, int use_sdr, int samplerate, double rx_gain, double page_gain, int page_sequence, 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, double squelch_db, const char *operator)
{
anetz_t *anetz;
int rc;
- if (kanal < 30 || kanal > 63) {
- PDEBUG(DANETZ, DEBUG_ERROR, "Channel ('Kanal') number %d invalid.\n", kanal);
+ if (atoi(kanal) < 30 || atoi(kanal) > 63) {
+ PDEBUG(DANETZ, DEBUG_ERROR, "Channel ('Kanal') number %s invalid.\n", kanal);
return -EINVAL;
}
@@ -204,10 +204,10 @@ int anetz_create(int kanal, const char *audiodev, int use_sdr, int samplerate, d
anetz->operator = operator;
- PDEBUG(DANETZ, DEBUG_DEBUG, "Creating 'A-Netz' instance for 'Kanal' = %d (sample rate %d).\n", kanal, samplerate);
+ PDEBUG(DANETZ, DEBUG_DEBUG, "Creating 'A-Netz' instance for 'Kanal' = %s (sample rate %d).\n", kanal, samplerate);
/* init general part of transceiver */
- rc = sender_create(&anetz->sender, kanal, anetz_kanal2freq(kanal, 0), anetz_kanal2freq(kanal, 1), audiodev, use_sdr, samplerate, rx_gain, pre_emphasis, de_emphasis, write_rx_wave, write_tx_wave, read_rx_wave, read_tx_wave, loopback, PAGING_SIGNAL_NONE);
+ rc = sender_create(&anetz->sender, kanal, anetz_kanal2freq(atoi(kanal), 0), anetz_kanal2freq(atoi(kanal), 1), audiodev, use_sdr, samplerate, rx_gain, pre_emphasis, de_emphasis, write_rx_wave, write_tx_wave, read_rx_wave, read_tx_wave, loopback, PAGING_SIGNAL_NONE);
if (rc < 0) {
PDEBUG(DANETZ, DEBUG_ERROR, "Failed to init 'Sender' processing!\n");
goto error;
@@ -225,7 +225,7 @@ int anetz_create(int kanal, const char *audiodev, int use_sdr, int samplerate, d
/* go into idle state */
anetz_go_idle(anetz);
- PDEBUG(DANETZ, DEBUG_NOTICE, "Created 'Kanal' #%d\n", kanal);
+ PDEBUG(DANETZ, DEBUG_NOTICE, "Created 'Kanal' #%s\n", kanal);
return 0;
@@ -240,7 +240,7 @@ void anetz_destroy(sender_t *sender)
{
anetz_t *anetz = (anetz_t *) sender;
- PDEBUG(DANETZ, DEBUG_DEBUG, "Destroying 'A-Netz' instance for 'Kanal' = %d.\n", sender->kanal);
+ PDEBUG(DANETZ, DEBUG_DEBUG, "Destroying 'A-Netz' instance for 'Kanal' = %s.\n", sender->kanal);
timer_exit(&anetz->timer);
dsp_cleanup_sender(anetz);
@@ -253,7 +253,7 @@ static void anetz_go_idle(anetz_t *anetz)
{
timer_stop(&anetz->timer);
- PDEBUG(DANETZ, DEBUG_INFO, "Entering IDLE state on channel %d, sending 2280 Hz tone.\n", anetz->sender.kanal);
+ PDEBUG(DANETZ, DEBUG_INFO, "Entering IDLE state on channel %s, sending 2280 Hz tone.\n", anetz->sender.kanal);
anetz->station_id[0] = '\0'; /* remove station ID before state change, so status is shown correctly */
anetz_new_state(anetz, ANETZ_FREI);
/* also reset detector, so if there is a new call it is answered */
diff --git a/src/anetz/anetz.h b/src/anetz/anetz.h
index 9a813cd..1278315 100644
--- a/src/anetz/anetz.h
+++ b/src/anetz/anetz.h
@@ -54,7 +54,7 @@ typedef struct anetz {
double anetz_kanal2freq(int kanal, int unterband);
int anetz_init(void);
-int anetz_create(int kanal, const char *audiodev, int use_sdr, int samplerate, double rx_gain, double page_gain, int page_sequence, 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, double squelch_db, const char *operator);
+int anetz_create(const char *kanal, const char *audiodev, int use_sdr, int samplerate, double rx_gain, double page_gain, int page_sequence, 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, double squelch_db, const char *operator);
void anetz_destroy(sender_t *sender);
void anetz_loss_indication(anetz_t *anetz, double loss_time);
void anetz_receive_tone(anetz_t *anetz, int bit);
diff --git a/src/anetz/main.c b/src/anetz/main.c
index 470bda7..4de9435 100644
--- a/src/anetz/main.c
+++ b/src/anetz/main.c
@@ -185,7 +185,7 @@ int main(int argc, char *argv[])
fprintf(stderr, "Failed to create \"Sender\" instance. Quitting!\n");
goto fail;
}
- printf("Base station on channel %d ready, please tune transmitter to %.3f MHz and receiver to %.3f MHz. (%.3f MHz offset)\n", kanal[i], anetz_kanal2freq(kanal[i], 0) / 1e6, anetz_kanal2freq(kanal[i], 1) / 1e6, anetz_kanal2freq(kanal[i], 2) / 1e6);
+ printf("Base station on channel %s ready, please tune transmitter to %.3f MHz and receiver to %.3f MHz. (%.3f MHz offset)\n", kanal[i], anetz_kanal2freq(atoi(kanal[i]), 0) / 1e6, anetz_kanal2freq(atoi(kanal[i]), 1) / 1e6, anetz_kanal2freq(atoi(kanal[i]), 2) / 1e6);
}
main_mobile(&quit, latency, interval, NULL, station_id, 5);
diff --git a/src/bnetz/bnetz.c b/src/bnetz/bnetz.c
index b9663a4..4c597bb 100644
--- a/src/bnetz/bnetz.c
+++ b/src/bnetz/bnetz.c
@@ -157,27 +157,27 @@ static void bnetz_timeout(struct timer *timer);
static void bnetz_go_idle(bnetz_t *bnetz);
/* Create transceiver instance and link to a list. */
-int bnetz_create(int kanal, const char *audiodev, int use_sdr, int samplerate, double rx_gain, int gfs, 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, double squelch_db, const char *paging, int metering)
+int bnetz_create(const char *kanal, const char *audiodev, int use_sdr, int samplerate, double rx_gain, int gfs, 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, double squelch_db, const char *paging, int metering)
{
bnetz_t *bnetz;
enum paging_signal paging_signal = PAGING_SIGNAL_NONE;
char paging_file[255] = "", paging_on[255] = "", paging_off[255] = "";
int rc;
- if (!(kanal >= 1 && kanal <= 39) && !(kanal >= 50 && kanal <= 86)) {
- PDEBUG(DBNETZ, DEBUG_ERROR, "Channel ('Kanal') number %d invalid.\n", kanal);
+ if (!(atoi(kanal) >= 1 && atoi(kanal) <= 39) && !(atoi(kanal) >= 50 && atoi(kanal) <= 86)) {
+ PDEBUG(DBNETZ, DEBUG_ERROR, "Channel ('Kanal') number %s invalid.\n", kanal);
return -EINVAL;
}
- if (kanal == 19) {
- PDEBUG(DBNETZ, DEBUG_ERROR, "Selected calling channel ('Rufkanal') number %d can't be used as traffic channel.\n", kanal);
+ if (atoi(kanal) == 19) {
+ PDEBUG(DBNETZ, DEBUG_ERROR, "Selected calling channel ('Rufkanal') number %s can't be used as traffic channel.\n", kanal);
return -EINVAL;
}
- if (kanal >= 38 && kanal <= 39)
- PDEBUG(DBNETZ, DEBUG_NOTICE, "Selected channel ('Kanal') number %d may not be supported by older B1-Network phones.\n", kanal);
- if (kanal >= 50)
- PDEBUG(DBNETZ, DEBUG_NOTICE, "Selected channel ('Kanal') number %d belongs to B2-Network and is not supported by B1 phones.\n", kanal);
+ if (atoi(kanal) >= 38 && atoi(kanal) <= 39)
+ PDEBUG(DBNETZ, DEBUG_NOTICE, "Selected channel ('Kanal') number %s may not be supported by older B1-Network phones.\n", kanal);
+ if (atoi(kanal) >= 50)
+ PDEBUG(DBNETZ, DEBUG_NOTICE, "Selected channel ('Kanal') number %s belongs to B2-Network and is not supported by B1 phones.\n", kanal);
if ((gfs < 1 || gfs > 19)) {
PDEBUG(DBNETZ, DEBUG_ERROR, "Given 'Gruppenfreisignal' %d invalid.\n", gfs);
@@ -220,10 +220,10 @@ error_paging:
return -ENOMEM;
}
- PDEBUG(DBNETZ, DEBUG_DEBUG, "Creating 'B-Netz' instance for 'Kanal' = %d 'Gruppenfreisignal' = %d (sample rate %d).\n", kanal, gfs, samplerate);
+ PDEBUG(DBNETZ, DEBUG_DEBUG, "Creating 'B-Netz' instance for 'Kanal' = %s 'Gruppenfreisignal' = %d (sample rate %d).\n", kanal, gfs, samplerate);
/* init general part of transceiver */
- rc = sender_create(&bnetz->sender, kanal, bnetz_kanal2freq(kanal, 0), bnetz_kanal2freq(kanal, 1), audiodev, use_sdr, samplerate, rx_gain, pre_emphasis, de_emphasis, write_rx_wave, write_tx_wave, read_rx_wave, read_tx_wave, loopback, paging_signal);
+ rc = sender_create(&bnetz->sender, kanal, bnetz_kanal2freq(atoi(kanal), 0), bnetz_kanal2freq(atoi(kanal), 1), audiodev, use_sdr, samplerate, rx_gain, pre_emphasis, de_emphasis, write_rx_wave, write_tx_wave, read_rx_wave, read_tx_wave, loopback, paging_signal);
if (rc < 0) {
PDEBUG(DBNETZ, DEBUG_ERROR, "Failed to init transceiver process!\n");
goto error;
@@ -247,7 +247,7 @@ error_paging:
/* go into idle state */
bnetz_go_idle(bnetz);
- PDEBUG(DBNETZ, DEBUG_NOTICE, "Created 'Kanal' #%d\n", kanal);
+ PDEBUG(DBNETZ, DEBUG_NOTICE, "Created 'Kanal' #%s\n", kanal);
PDEBUG(DBNETZ, DEBUG_NOTICE, " -> Using station ID (Gruppenfreisignal) %d\n", gfs);
return 0;
@@ -263,7 +263,7 @@ void bnetz_destroy(sender_t *sender)
{
bnetz_t *bnetz = (bnetz_t *) sender;
- PDEBUG(DBNETZ, DEBUG_DEBUG, "Destroying 'B-Netz' instance for 'Kanal' = %d.\n", sender->kanal);
+ PDEBUG(DBNETZ, DEBUG_DEBUG, "Destroying 'B-Netz' instance for 'Kanal' = %s.\n", sender->kanal);
switch_channel_19(bnetz, 0);
dsp_cleanup_sender(bnetz);
timer_exit(&bnetz->timer);
@@ -276,7 +276,7 @@ static void bnetz_go_idle(bnetz_t *bnetz)
{
timer_stop(&bnetz->timer);
- PDEBUG(DBNETZ, DEBUG_INFO, "Entering IDLE state on channel %d, sending 'Gruppenfreisignal' %d.\n", bnetz->sender.kanal, bnetz->gfs);
+ PDEBUG(DBNETZ, DEBUG_INFO, "Entering IDLE state on channel %s, sending 'Gruppenfreisignal' %d.\n", bnetz->sender.kanal, bnetz->gfs);
bnetz->station_id[0] = '\0'; /* remove station ID before state change, so status is shown correctly */
bnetz_new_state(bnetz, BNETZ_FREI);
bnetz_set_dsp_mode(bnetz, DSP_MODE_TELEGRAMM);
@@ -342,7 +342,7 @@ const char *bnetz_get_telegramm(bnetz_t *bnetz)
return NULL;
}
if (bnetz->station_id_pos == 5) {
- it = bnetz_digit2telegramm(bnetz->sender.kanal + 1000);
+ it = bnetz_digit2telegramm(atoi(bnetz->sender.kanal) + 1000);
bnetz->page_mode = PAGE_MODE_KANALBEFEHL;
break;
}
@@ -656,7 +656,7 @@ static void bnetz_timeout(struct timer *timer)
bnetz_set_dsp_mode(bnetz, DSP_MODE_TELEGRAMM);
break;
case BNETZ_SELEKTIVRUF_AUS:
- PDEBUG_CHAN(DBNETZ, DEBUG_DEBUG, "Transmitter switched back to channel %d, waiting for paging response.\n", bnetz->sender.kanal);
+ PDEBUG_CHAN(DBNETZ, DEBUG_DEBUG, "Transmitter switched back to channel %s, waiting for paging response.\n", bnetz->sender.kanal);
bnetz_new_state(bnetz, BNETZ_RUFBESTAETIGUNG);
switch_channel_19(bnetz, 0);
timer_start(&bnetz->timer, PAGING_TO);
diff --git a/src/bnetz/bnetz.h b/src/bnetz/bnetz.h
index 71acab9..c520902 100644
--- a/src/bnetz/bnetz.h
+++ b/src/bnetz/bnetz.h
@@ -112,7 +112,7 @@ typedef struct bnetz {
double bnetz_kanal2freq(int kanal, int unterband);
int bnetz_init(void);
-int bnetz_create(int kanal, const char *audiodev, int use_sdr, int samplerate, double rx_gain, int gfs, 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, double squelch_db, const char *paging, int metering);
+int bnetz_create(const char *kanal, const char *audiodev, int use_sdr, int samplerate, double rx_gain, int gfs, 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, double squelch_db, const char *paging, int metering);
void bnetz_destroy(sender_t *sender);
void bnetz_loss_indication(bnetz_t *bnetz, double loss_time);
void bnetz_receive_tone(bnetz_t *bnetz, int bit);
diff --git a/src/bnetz/main.c b/src/bnetz/main.c
index 88cd700..b78352b 100644
--- a/src/bnetz/main.c
+++ b/src/bnetz/main.c
@@ -190,7 +190,7 @@ int main(int argc, char *argv[])
fprintf(stderr, "Failed to create \"Sender\" instance. Quitting!\n");
goto fail;
}
- printf("Base station for channel %d ready, please tune transmitter to %.3f MHz and receiver " "to %.3f MHz. (%.3f MHz offset)\n", kanal[i], bnetz_kanal2freq(kanal[i], 0) / 1e6, bnetz_kanal2freq(kanal[i], 1) / 1e6, bnetz_kanal2freq(kanal[i], 2) / 1e6);
+ printf("Base station for channel %s ready, please tune transmitter to %.3f MHz and receiver " "to %.3f MHz. (%.3f MHz offset)\n", kanal[i], bnetz_kanal2freq(atoi(kanal[i]), 0) / 1e6, bnetz_kanal2freq(atoi(kanal[i]), 1) / 1e6, bnetz_kanal2freq(atoi(kanal[i]), 2) / 1e6);
printf("To call phone, switch transmitter (using paging signal) to %.3f MHz.\n", bnetz_kanal2freq(19, 0) / 1e6);
}
diff --git a/src/cnetz/cnetz.c b/src/cnetz/cnetz.c
index 7ccfc3b..5d0dd69 100644
--- a/src/cnetz/cnetz.c
+++ b/src/cnetz/cnetz.c
@@ -246,38 +246,38 @@ int cnetz_init(void)
}
/* Create transceiver instance and link to a list. */
-int cnetz_create(int kanal, enum cnetz_chan_type chan_type, const char *audiodev, int use_sdr, enum demod_type demod, int samplerate, double rx_gain, int challenge_valid, uint64_t challenge, int response_valid, uint64_t response, int warteschlange, int metering, double dbm0_deviation, int ms_power, int measure_speed, double clock_speed[2], int polarity, 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)
+int cnetz_create(const char *kanal, enum cnetz_chan_type chan_type, const char *audiodev, int use_sdr, enum demod_type demod, int samplerate, double rx_gain, int challenge_valid, uint64_t challenge, int response_valid, uint64_t response, int warteschlange, int metering, double dbm0_deviation, int ms_power, int measure_speed, double clock_speed[2], int polarity, 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)
{
sender_t *sender;
cnetz_t *cnetz;
int rc;
- if ((kanal & 1) && kanal < 1 && kanal > 1147) {
- PDEBUG(DCNETZ, DEBUG_ERROR, "Channel ('Kanal') number %d invalid.\n", kanal);
+ if ((atoi(kanal) & 1) && atoi(kanal) < 1 && atoi(kanal) > 1147) {
+ PDEBUG(DCNETZ, DEBUG_ERROR, "Channel ('Kanal') number %s invalid.\n", kanal);
return -EINVAL;
}
- if ((kanal & 1) && kanal > 947) {
- PDEBUG(DCNETZ, DEBUG_NOTICE, "You defined an extended frequency %d, only newer phones support this!\n", kanal);
+ if ((atoi(kanal) & 1) && atoi(kanal) > 947) {
+ PDEBUG(DCNETZ, DEBUG_NOTICE, "You defined an extended frequency channel %s, only newer phones support this!\n", kanal);
}
- if (!(kanal & 1) && kanal < 2 && kanal > 918) {
- PDEBUG(DCNETZ, DEBUG_ERROR, "Channel ('Kanal') number %d invalid.\n", kanal);
+ if (!(atoi(kanal) & 1) && atoi(kanal) < 2 && atoi(kanal) > 918) {
+ PDEBUG(DCNETZ, DEBUG_ERROR, "Channel ('Kanal') number %s invalid.\n", kanal);
return -EINVAL;
}
- if (!(kanal & 1) && kanal > 758) {
- PDEBUG(DCNETZ, DEBUG_NOTICE, "You defined an extended frequency %d, only newer phones support this!\n", kanal);
+ if (!(atoi(kanal) & 1) && atoi(kanal) > 758) {
+ PDEBUG(DCNETZ, DEBUG_NOTICE, "You defined an extended frequency %s, only newer phones support this!\n", kanal);
}
- if (kanal == 1 || kanal == 2) {
- PDEBUG(DCNETZ, DEBUG_NOTICE, "Channel ('Kanal') number %d is specified as 'unused', it might not work!\n", kanal);
+ if (atoi(kanal) == 1 || atoi(kanal) == 2) {
+ PDEBUG(DCNETZ, DEBUG_NOTICE, "Channel ('Kanal') number %s is specified as 'unused', it might not work!\n", kanal);
}
/* OgK must be on channel 131 */
- if ((chan_type == CHAN_TYPE_OGK || chan_type == CHAN_TYPE_OGK_SPK) && kanal != CNETZ_OGK_KANAL) {
+ if ((chan_type == CHAN_TYPE_OGK || chan_type == CHAN_TYPE_OGK_SPK) && atoi(kanal) != CNETZ_OGK_KANAL) {
PDEBUG(DCNETZ, DEBUG_NOTICE, "You must use channel %d for calling channel ('Orga-Kanal') or for combined calling + traffic channel!\n", CNETZ_OGK_KANAL);
return -EINVAL;
}
/* SpK must be on channel other than 131 */
- if (chan_type == CHAN_TYPE_SPK && kanal == CNETZ_OGK_KANAL) {
+ if (chan_type == CHAN_TYPE_SPK && atoi(kanal) == CNETZ_OGK_KANAL) {
PDEBUG(DCNETZ, DEBUG_NOTICE, "You must not use channel %d for traffic channel!\n", CNETZ_OGK_KANAL);
return -EINVAL;
}
@@ -301,11 +301,11 @@ int cnetz_create(int kanal, enum cnetz_chan_type chan_type, const char *audiodev
return -ENOMEM;
}
- PDEBUG(DCNETZ, DEBUG_DEBUG, "Creating 'C-Netz' instance for 'Kanal' = %d (sample rate %d).\n", kanal, samplerate);
+ PDEBUG(DCNETZ, DEBUG_DEBUG, "Creating 'C-Netz' instance for 'Kanal' = %s (sample rate %d).\n", kanal, samplerate);
/* init general part of transceiver */
/* do not enable emphasis, since it is done by cnetz code, not by common sender code */
- rc = sender_create(&cnetz->sender, kanal, cnetz_kanal2freq(kanal, 0), cnetz_kanal2freq(kanal, 1), audiodev, use_sdr, samplerate, rx_gain, 0, 0, write_rx_wave, write_tx_wave, read_rx_wave, read_tx_wave, loopback, PAGING_SIGNAL_NONE);
+ rc = sender_create(&cnetz->sender, kanal, cnetz_kanal2freq(atoi(kanal), 0), cnetz_kanal2freq(atoi(kanal), 1), audiodev, use_sdr, samplerate, rx_gain, 0, 0, write_rx_wave, write_tx_wave, read_rx_wave, read_tx_wave, loopback, PAGING_SIGNAL_NONE);
if (rc < 0) {
PDEBUG(DCNETZ, DEBUG_ERROR, "Failed to init transceiver process!\n");
goto error;
@@ -401,7 +401,7 @@ int cnetz_create(int kanal, enum cnetz_chan_type chan_type, const char *audiodev
cnetz_flush_other_transactions(cnetz, trans2);
#endif
- PDEBUG(DCNETZ, DEBUG_NOTICE, "Created 'Kanal' #%d of type '%s' = %s\n", kanal, chan_type_short_name(chan_type), chan_type_long_name(chan_type));
+ PDEBUG(DCNETZ, DEBUG_NOTICE, "Created 'Kanal' #%s of type '%s' = %s\n", kanal, chan_type_short_name(chan_type), chan_type_long_name(chan_type));
return 0;
@@ -417,7 +417,7 @@ void cnetz_destroy(sender_t *sender)
cnetz_t *cnetz = (cnetz_t *) sender;
transaction_t *trans;
- PDEBUG(DCNETZ, DEBUG_DEBUG, "Destroying 'C-Netz' instance for 'Kanal' = %d.\n", sender->kanal);
+ PDEBUG(DCNETZ, DEBUG_DEBUG, "Destroying 'C-Netz' instance for 'Kanal' = %s.\n", sender->kanal);
while ((trans = search_transaction(cnetz, ~0))) {
const char *rufnummer = transaction2rufnummer(trans);
@@ -439,9 +439,9 @@ static cnetz_t *search_free_spk(int extended)
cnetz = (cnetz_t *) sender;
/* ignore extended frequency, if not supported */
if (!extended) {
- if ((sender->kanal & 1) && sender->kanal > 947)
+ if ((atoi(sender->kanal) & 1) && atoi(sender->kanal) > 947)
continue;
- if (!(sender->kanal & 1) && sender->kanal > 758)
+ if (!(atoi(sender->kanal) & 1) && atoi(sender->kanal) > 758)
continue;
}
/* ignore busy channel */
@@ -493,16 +493,16 @@ void cnetz_go_idle(cnetz_t *cnetz)
destroy_transaction(cnetz->trans_list);
}
- PDEBUG(DCNETZ, DEBUG_INFO, "Entering IDLE state on channel %d.\n", cnetz->sender.kanal);
+ PDEBUG(DCNETZ, DEBUG_INFO, "Entering IDLE state on channel %s.\n", cnetz->sender.kanal);
cnetz_new_state(cnetz, CNETZ_IDLE);
/* set scheduler to OgK or turn off SpK */
if (cnetz->dsp_mode == DSP_MODE_SPK_K || cnetz->dsp_mode == DSP_MODE_SPK_V) {
/* go idle after next frame/slot */
- cnetz_set_sched_dsp_mode(cnetz, (cnetz->sender.kanal == CNETZ_OGK_KANAL) ? DSP_MODE_OGK : DSP_MODE_OFF, 1);
+ cnetz_set_sched_dsp_mode(cnetz, (atoi(cnetz->sender.kanal) == CNETZ_OGK_KANAL) ? DSP_MODE_OGK : DSP_MODE_OFF, 1);
} else {
- cnetz_set_sched_dsp_mode(cnetz, (cnetz->sender.kanal == CNETZ_OGK_KANAL) ? DSP_MODE_OGK : DSP_MODE_OFF, 0);
- cnetz_set_dsp_mode(cnetz, (cnetz->sender.kanal == CNETZ_OGK_KANAL) ? DSP_MODE_OGK : DSP_MODE_OFF);
+ cnetz_set_sched_dsp_mode(cnetz, (atoi(cnetz->sender.kanal) == CNETZ_OGK_KANAL) ? DSP_MODE_OGK : DSP_MODE_OFF, 0);
+ cnetz_set_dsp_mode(cnetz, (atoi(cnetz->sender.kanal) == CNETZ_OGK_KANAL) ? DSP_MODE_OGK : DSP_MODE_OFF);
}
/* check for first phone in queue and trigger completion of call (becoming idle means that SpK is now available) */
@@ -1032,14 +1032,14 @@ vak:
break;
}
if (spk == cnetz) {
- PDEBUG(DCNETZ, DEBUG_INFO, "Staying on combined calling + traffic channel %d\n", spk->sender.kanal);
+ PDEBUG(DCNETZ, DEBUG_INFO, "Staying on combined calling + traffic channel %s\n", spk->sender.kanal);
} else {
- PDEBUG(DCNETZ, DEBUG_INFO, "Assigning phone to traffic channel %d\n", spk->sender.kanal);
+ PDEBUG(DCNETZ, DEBUG_INFO, "Assigning phone to traffic channel %s\n", spk->sender.kanal);
/* sync RX time to current OgK time */
fsk_copy_sync(&spk->fsk_demod, &cnetz->fsk_demod);
}
/* set channel */
- telegramm.frequenz_nr = spk->sender.kanal;
+ telegramm.frequenz_nr = atoi(spk->sender.kanal);
/* change state to busy */
cnetz_new_state(spk, CNETZ_BUSY);
/* schedule switching two slots ahead */
@@ -1282,7 +1282,7 @@ const telegramm_t *cnetz_transmit_telegramm_spk_k(cnetz_t *cnetz)
telegramm.futln_nationalitaet = trans->futln_nat;
telegramm.futln_heimat_fuvst_nr = trans->futln_fuvst;
telegramm.futln_rest_nr = trans->futln_rest;
- telegramm.frequenz_nr = cnetz->sender.kanal;
+ telegramm.frequenz_nr = atoi(cnetz->sender.kanal);
telegramm.bedingte_genauigkeit_der_fufst = si[cnetz->cell_nr].genauigkeit;
telegramm.zufallszahl = cnetz->challenge;
@@ -1612,7 +1612,7 @@ const telegramm_t *cnetz_transmit_telegramm_spk_v(cnetz_t *cnetz)
telegramm.futln_nationalitaet = trans->futln_nat;
telegramm.futln_heimat_fuvst_nr = trans->futln_fuvst;
telegramm.futln_rest_nr = trans->futln_rest;
- telegramm.frequenz_nr = cnetz->sender.kanal;
+ telegramm.frequenz_nr = atoi(cnetz->sender.kanal);
telegramm.entfernung = si[cnetz->cell_nr].entfernung;
telegramm.bedingte_genauigkeit_der_fufst = si[cnetz->cell_nr].genauigkeit;
telegramm.gueltigkeit_des_gebuehrenstandes = 0;
diff --git a/src/cnetz/cnetz.h b/src/cnetz/cnetz.h
index d27b8fd..abdab51 100644
--- a/src/cnetz/cnetz.h
+++ b/src/cnetz/cnetz.h
@@ -138,7 +138,7 @@ int cnetz_channel_by_short_name(const char *short_name);
const char *chan_type_short_name(enum cnetz_chan_type chan_type);
const char *chan_type_long_name(enum cnetz_chan_type chan_type);
int cnetz_init(void);
-int cnetz_create(int kanal, enum cnetz_chan_type chan_type, const char *audiodev, int use_sdr, enum demod_type demod, int samplerate, double rx_gain, int challenge_valid, uint64_t challenge, int response_valid, uint64_t response, int warteschlange, int metering, double dbm0_deviation, int ms_power, int measure_speed, double clock_speed[2], int polarity, 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);
+int cnetz_create(const char *kanal, enum cnetz_chan_type chan_type, const char *audiodev, int use_sdr, enum demod_type demod, int samplerate, double rx_gain, int challenge_valid, uint64_t challenge, int response_valid, uint64_t response, int warteschlange, int metering, double dbm0_deviation, int ms_power, int measure_speed, double clock_speed[2], int polarity, 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);
void cnetz_destroy(sender_t *sender);
void cnetz_go_idle(cnetz_t *cnetz);
void cnetz_sync_frame(cnetz_t *cnetz, double sync, int ts);
diff --git a/src/cnetz/main.c b/src/cnetz/main.c
index 7acca67..df0403a 100644
--- a/src/cnetz/main.c
+++ b/src/cnetz/main.c
@@ -579,10 +579,10 @@ int main(int argc, char *argv[])
fprintf(stderr, "Failed to create \"Sender\" instance. Quitting!\n");
goto fail;
}
- if ((kanal[i] & 1)) {
- printf("Base station on channel %d ready, please tune transmitter to %.3f MHz and receiver to %.3f MHz. (%.3f MHz offset)\n", kanal[i], cnetz_kanal2freq(kanal[i], 0) / 1e6, cnetz_kanal2freq(kanal[i], 1) / 1e6, cnetz_kanal2freq(kanal[i], 2) / 1e6);
+ if ((atoi(kanal[i]) & 1)) {
+ printf("Base station on channel %s ready, please tune transmitter to %.3f MHz and receiver to %.3f MHz. (%.3f MHz offset)\n", kanal[i], cnetz_kanal2freq(atoi(kanal[i]), 0) / 1e6, cnetz_kanal2freq(atoi(kanal[i]), 1) / 1e6, cnetz_kanal2freq(atoi(kanal[i]), 2) / 1e6);
} else {
- printf("Base station on channel %d ready, please tune transmitter to %.4f MHz and receiver to %.4f MHz. (%.3f MHz offset)\n", kanal[i], cnetz_kanal2freq(kanal[i], 0) / 1e6, cnetz_kanal2freq(kanal[i], 1) / 1e6, cnetz_kanal2freq(kanal[i], 2) / 1e6);
+ printf("Base station on channel %s ready, please tune transmitter to %.4f MHz and receiver to %.4f MHz. (%.3f MHz offset)\n", kanal[i], cnetz_kanal2freq(atoi(kanal[i]), 0) / 1e6, cnetz_kanal2freq(atoi(kanal[i]), 1) / 1e6, cnetz_kanal2freq(atoi(kanal[i]), 2) / 1e6);
}
}
diff --git a/src/jolly/jolly.c b/src/jolly/jolly.c
index d235903..33dd0b8 100644
--- a/src/jolly/jolly.c
+++ b/src/jolly/jolly.c
@@ -212,7 +212,7 @@ static void jolly_speech_timeout(struct timer *timer);
static void jolly_go_idle(jolly_t *jolly);
/* Create transceiver instance and link to a list. */
-int jolly_create(int kanal, double dl_freq, double ul_freq, double step, 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, double squelch_db, int nbfm, int repeater)
+int jolly_create(const char *kanal, double dl_freq, double ul_freq, double step, 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, double squelch_db, int nbfm, int repeater)
{
jolly_t *jolly;
int rc;
@@ -223,10 +223,10 @@ int jolly_create(int kanal, double dl_freq, double ul_freq, double step, const c
return -EIO;
}
- PDEBUG(DJOLLY, DEBUG_DEBUG, "Creating 'JollyCom' instance for 'Kanal' = %d (sample rate %d).\n", kanal, samplerate);
+ PDEBUG(DJOLLY, DEBUG_DEBUG, "Creating 'JollyCom' instance for 'Kanal' = %s (sample rate %d).\n", kanal, samplerate);
- dl_freq = dl_freq * 1e6 + step * 1e3 * (double)kanal;
- ul_freq = ul_freq * 1e6 + step * 1e3 * (double)kanal;
+ dl_freq = dl_freq * 1e6 + step * 1e3 * (double)atoi(kanal);
+ ul_freq = ul_freq * 1e6 + step * 1e3 * (double)atoi(kanal);
/* init general part of transceiver */
rc = sender_create(&jolly->sender, kanal, dl_freq, ul_freq, audiodev, use_sdr, samplerate, rx_gain, pre_emphasis, de_emphasis, write_rx_wave, write_tx_wave, read_rx_wave, read_tx_wave, loopback, PAGING_SIGNAL_NONE);
@@ -249,7 +249,7 @@ int jolly_create(int kanal, double dl_freq, double ul_freq, double step, const c
/* go into idle state */
jolly_go_idle(jolly);
- PDEBUG(DJOLLY, DEBUG_NOTICE, "Created 'Kanal' #%d\n", kanal);
+ PDEBUG(DJOLLY, DEBUG_NOTICE, "Created 'Kanal' #%s\n", kanal);
return 0;
@@ -264,7 +264,7 @@ void jolly_destroy(sender_t *sender)
{
jolly_t *jolly = (jolly_t *) sender;
- PDEBUG(DJOLLY, DEBUG_DEBUG, "Destroying 'JollyCom' instance for 'Kanal' = %d.\n", sender->kanal);
+ PDEBUG(DJOLLY, DEBUG_DEBUG, "Destroying 'JollyCom' instance for 'Kanal' = %s.\n", sender->kanal);
dsp_cleanup_sender(jolly);
timer_exit(&jolly->timer);
@@ -280,7 +280,7 @@ static void jolly_go_idle(jolly_t *jolly)
timer_stop(&jolly->speech_timer);
reset_speech_string(jolly);
- PDEBUG(DJOLLY, DEBUG_INFO, "Entering IDLE state on channel %d.\n", jolly->sender.kanal);
+ PDEBUG(DJOLLY, DEBUG_INFO, "Entering IDLE state on channel %s.\n", jolly->sender.kanal);
jolly->dialing[0] = '\0';
jolly->station_id[0] = '\0'; /* remove station ID before state change, so status is shown correctly */
jolly_new_state(jolly, STATE_IDLE);
@@ -293,7 +293,7 @@ static void jolly_release(jolly_t *jolly)
timer_stop(&jolly->speech_timer);
reset_speech_string(jolly);
- PDEBUG(DJOLLY, DEBUG_INFO, "Sending Release sequence on channel %d.\n", jolly->sender.kanal);
+ PDEBUG(DJOLLY, DEBUG_INFO, "Sending Release sequence on channel %s.\n", jolly->sender.kanal);
timer_start(&jolly->speech_timer, SPEECH_DELAY_RELEASE);
jolly_new_state(jolly, STATE_RELEASED);
}
diff --git a/src/jolly/jolly.h b/src/jolly/jolly.h
index 52acbcf..243b8ea 100644
--- a/src/jolly/jolly.h
+++ b/src/jolly/jolly.h
@@ -50,7 +50,7 @@ typedef struct jolly {
int delay_max; /* number of samples in delay buffer */
} jolly_t;
-int jolly_create(int kanal, double dl_freq, double ul_freq, double step, 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, double squelch_db, int nbfm, int repeater);
+int jolly_create(const char *kanal, double dl_freq, double ul_freq, double step, 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, double squelch_db, int nbfm, int repeater);
void jolly_destroy(sender_t *sender);
void speech_finished(jolly_t *jolly);
void jolly_receive_dtmf(void *priv, char digit, dtmf_meas_t *meas);
diff --git a/src/jolly/main.c b/src/jolly/main.c
index 4fcbb6b..905baff 100644
--- a/src/jolly/main.c
+++ b/src/jolly/main.c
@@ -196,7 +196,7 @@ int main(int argc, char *argv[])
fprintf(stderr, "Failed to create transceiver instance. Quitting!\n");
goto fail;
}
- printf("base station on channel %d ready, please tune transmitter to %.4f MHz and receiver to %.4f MHz. (%.4f MHz offset)\n", kanal[i], dl_freq + step / 1e3 * (double)kanal[i], ul_freq + step / 1e3 * (double)kanal[i], ul_freq - dl_freq);
+ printf("base station on channel %s ready, please tune transmitter to %.4f MHz and receiver to %.4f MHz. (%.4f MHz offset)\n", kanal[i], dl_freq + step / 1e3 * (double)atoi(kanal[i]), ul_freq + step / 1e3 * (double)atoi(kanal[i]), ul_freq - dl_freq);
}
main_mobile(&quit, latency, interval, NULL, station_id, 4);
diff --git a/src/libdebug/debug.c b/src/libdebug/debug.c
index 934294b..cbafb4f 100644
--- a/src/libdebug/debug.c
+++ b/src/libdebug/debug.c
@@ -94,7 +94,7 @@ void get_win_size(int *w, int *h)
*w = MAX_DISPLAY_WIDTH - 1;
}
-void _printdebug(const char *file, const char __attribute__((unused)) *function, int line, int cat, int level, int chan, const char *fmt, ...)
+void _printdebug(const char *file, const char __attribute__((unused)) *function, int line, int cat, int level, const char *kanal, const char *fmt, ...)
{
char buffer[4096], *b = buffer;
int s = sizeof(buffer) - 1;
@@ -107,9 +107,9 @@ void _printdebug(const char *file, const char __attribute__((unused)) *function,
buffer[sizeof(buffer) - 1] = '\0';
- /* if chan is used, prefix the channel number */
- if (num_kanal > 1 && chan >= 0) {
- sprintf(buffer, "(chan %d) ", chan);
+ /* if kanal is used, prefix the channel number */
+ if (num_kanal > 1 && kanal) {
+ sprintf(buffer, "(chan %s) ", kanal);
b = strchr(buffer, '\0');
s -= strlen(buffer);
}
diff --git a/src/libdebug/debug.h b/src/libdebug/debug.h
index cfc420a..6da992f 100644
--- a/src/libdebug/debug.h
+++ b/src/libdebug/debug.h
@@ -30,9 +30,9 @@
void get_win_size(int *w, int *h);
-#define PDEBUG(cat, level, fmt, arg...) _printdebug(__FILE__, __FUNCTION__, __LINE__, cat, level, -1, fmt, ## arg)
+#define PDEBUG(cat, level, fmt, arg...) _printdebug(__FILE__, __FUNCTION__, __LINE__, cat, level, NULL, fmt, ## arg)
#define PDEBUG_CHAN(cat, level, fmt, arg...) _printdebug(__FILE__, __FUNCTION__, __LINE__, cat, level, CHAN, fmt, ## arg)
-void _printdebug(const char *file, const char *function, int line, int cat, int level, int chan, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 7, 8)));
+void _printdebug(const char *file, const char *function, int line, int cat, int level, const char *chan_str, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 7, 8)));
const char *debug_amplitude(double level);
const char *debug_db(double level_db);
diff --git a/src/libdisplay/display.h b/src/libdisplay/display.h
index b3762de..064e327 100644
--- a/src/libdisplay/display.h
+++ b/src/libdisplay/display.h
@@ -5,7 +5,7 @@
#define MAX_DISPLAY_WIDTH 1024
typedef struct display_wave {
- int kanal;
+ const char *kanal;
int interval_pos;
int interval_max;
int offset;
@@ -44,7 +44,7 @@ typedef struct display_measurements_param {
typedef struct display_measurements {
struct display_measurements *next;
- int kanal;
+ const char *kanal;
dispmeasparam_t *param;
} dispmeas_t;
@@ -60,7 +60,7 @@ typedef struct display_iq {
typedef struct display_spectrum_mark {
struct display_spectrum_mark *next;
- int kanal;
+ const char *kanal;
double frequency;
} dispspectrum_mark_t;
@@ -74,17 +74,17 @@ typedef struct display_spectrum {
#define MAX_HEIGHT_STATUS 32
-void display_wave_init(dispwav_t *disp, int samplerate, int kanal);
+void display_wave_init(dispwav_t *disp, int samplerate, const char *kanal);
void display_wave_on(int on);
void display_wave(dispwav_t *disp, sample_t *samples, int length, double range);
void display_status_on(int on);
void display_status_start(void);
-void display_status_channel(int channel, const char *type, const char *state);
+void display_status_channel(const char *kanal, const char *type, const char *state);
void display_status_subscriber(const char *number, const char *state);
void display_status_end(void);
-void display_measurements_init(dispmeas_t *disp, int samplerate, int kanal);
+void display_measurements_init(dispmeas_t *disp, int samplerate, const char *kanal);
void display_measurements_exit(dispmeas_t *disp);
void display_measurements_on(int on);
dispmeasparam_t *display_measurements_add(dispmeas_t *disp, char *name, char *format, enum display_measurements_type type, enum display_measurements_bar bar, double min, double max, double mark);
@@ -96,7 +96,7 @@ void display_iq_on(int on);
void display_iq(float *samples, int length);
void display_spectrum_init(int samplerate, double center_frequency);
-void display_spectrum_add_mark(int kanal, double frequency);
+void display_spectrum_add_mark(const char *kanal, double frequency);
void display_spectrum_exit(void);
void display_spectrum_on(int on);
void display_spectrum(float *samples, int length);
diff --git a/src/libdisplay/display_measurements.c b/src/libdisplay/display_measurements.c
index 8659886..ff388d3 100644
--- a/src/libdisplay/display_measurements.c
+++ b/src/libdisplay/display_measurements.c
@@ -40,7 +40,7 @@ static char line_color[MAX_DISPLAY_WIDTH];
dispmeas_t *meas_head = NULL;
-void display_measurements_init(dispmeas_t *disp, int __attribute__((unused)) samplerate, int kanal)
+void display_measurements_init(dispmeas_t *disp, int __attribute__((unused)) samplerate, const char *kanal)
{
dispmeas_t **disp_p;
@@ -114,7 +114,7 @@ static void print_measurements(int on)
for (disp = meas_head; disp; disp = disp->next) {
memset(line, ' ', width);
memset(line_color, 7, width);
- sprintf(line, "(chan %d", disp->kanal);
+ sprintf(line, "(chan %s", disp->kanal);
*strchr(line, '\0') = ')';
display_line(on, width);
for (param = disp->param; param; param = param->next) {
diff --git a/src/libdisplay/display_spectrum.c b/src/libdisplay/display_spectrum.c
index 3fcba3c..c2fc1c3 100644
--- a/src/libdisplay/display_spectrum.c
+++ b/src/libdisplay/display_spectrum.c
@@ -55,7 +55,7 @@ void display_spectrum_init(int samplerate, double _center_frequency)
has_init = 1;
}
-void display_spectrum_add_mark(int kanal, double frequency)
+void display_spectrum_add_mark(const char *kanal, double frequency)
{
dispspectrum_mark_t *mark, **mark_p;
@@ -348,7 +348,7 @@ void display_spectrum(float *samples, int length)
screen[k][j] = ':';
screen_color[k][j] = 12;
}
- sprintf(print_channel, "Ch%d", mark->kanal);
+ sprintf(print_channel, "Ch%s", mark->kanal);
for (o = 0; o < (int)strlen(print_channel); o++) {
s = j - strlen(print_channel) + o;
if (s >= 0 && s < width) {
diff --git a/src/libdisplay/display_status.c b/src/libdisplay/display_status.c
index 9a38d36..c15b88b 100644
--- a/src/libdisplay/display_status.c
+++ b/src/libdisplay/display_status.c
@@ -87,7 +87,7 @@ void display_status_start(void)
line_count = 1;
}
-void display_status_channel(int channel, const char *type, const char *state)
+void display_status_channel(const char *kanal, const char *type, const char *state)
{
char line[MAX_DISPLAY_WIDTH];
@@ -99,9 +99,9 @@ void display_status_channel(int channel, const char *type, const char *state)
return;
if (type)
- snprintf(line, sizeof(line), "Channel: %d Type: %s State: %s", channel, type, state);
+ snprintf(line, sizeof(line), "Channel: %s Type: %s State: %s", kanal, type, state);
else
- snprintf(line, sizeof(line), "Channel: %d State: %s", channel, state);
+ snprintf(line, sizeof(line), "Channel: %s State: %s", kanal, state);
line[sizeof(line) - 1] = '\0';
memcpy(screen[line_count++], line, strlen(line));
}
diff --git a/src/libdisplay/display_wave.c b/src/libdisplay/display_wave.c
index e89fb3b..261c5bb 100644
--- a/src/libdisplay/display_wave.c
+++ b/src/libdisplay/display_wave.c
@@ -33,7 +33,7 @@ static int num_sender = 0;
static char screen[HEIGHT][MAX_DISPLAY_WIDTH];
static int wave_on = 0;
-void display_wave_init(dispwav_t *disp, int samplerate, int kanal)
+void display_wave_init(dispwav_t *disp, int samplerate, const char *kanal)
{
memset(disp, 0, sizeof(*disp));
disp->offset = (num_sender++) * HEIGHT;
@@ -198,7 +198,7 @@ void display_wave(dispwav_t *disp, sample_t *samples, int length, double range)
screen[k][j] = '|';
}
}
- sprintf(screen[0], "(chan %d", disp->kanal);
+ sprintf(screen[0], "(chan %s", disp->kanal);
*strchr(screen[0], '\0') = ')';
printf("\0337\033[H");
for (j = 0; j < disp->offset; j++)
diff --git a/src/libmobile/main_mobile.c b/src/libmobile/main_mobile.c
index e516afe..6b26e4e 100644
--- a/src/libmobile/main_mobile.c
+++ b/src/libmobile/main_mobile.c
@@ -50,7 +50,7 @@ static int got_init = 0;
/* common mobile settings */
int num_kanal = 0;
-int kanal[MAX_SENDER];
+const char *kanal[MAX_SENDER];
int num_audiodev = 0;
const char *audiodev[MAX_SENDER] = { "hw:0,0" };
int use_sdr = 0;
@@ -248,7 +248,7 @@ int main_mobile_handle_options(int short_option, int argi, char **argv)
break;
case 'k':
case OPT_CHANNEL:
- OPT_ARRAY(num_kanal, kanal, atoi(argv[argi]))
+ OPT_ARRAY(num_kanal, kanal, argv[argi])
break;
case 'a':
OPT_ARRAY(num_audiodev, audiodev, strdup(argv[argi]))
diff --git a/src/libmobile/main_mobile.h b/src/libmobile/main_mobile.h
index 0edf9ba..954b2d2 100644
--- a/src/libmobile/main_mobile.h
+++ b/src/libmobile/main_mobile.h
@@ -1,6 +1,6 @@
extern int num_kanal;
-extern int kanal[];
+extern const char *kanal[];
extern int swap_links;
extern int num_audiodev;
extern const char *audiodev[];
diff --git a/src/libmobile/sender.c b/src/libmobile/sender.c
index 1dcfc22..2d88eaa 100644
--- a/src/libmobile/sender.c
+++ b/src/libmobile/sender.c
@@ -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;
}
diff --git a/src/libmobile/sender.h b/src/libmobile/sender.h
index 6591f35..746a1d0 100644
--- a/src/libmobile/sender.h
+++ b/src/libmobile/sender.h
@@ -28,7 +28,7 @@ typedef struct sender {
struct sender *master; /* if set, the audio device is owned by 'master' */
/* system info */
- int kanal; /* channel number */
+ const char *kanal; /* channel number */
double sendefrequenz; /* transmitter frequency */
double empfangsfrequenz; /* receiver frequency */
double ruffrequenz; /* special paging frequency used for B-Netz */
@@ -90,7 +90,7 @@ typedef struct sender {
extern sender_t *sender_head;
extern int cant_recover;
-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);
void sender_destroy(sender_t *sender);
void sender_set_fm(sender_t *sender, double max_deviation, double max_modulation, double dBm0_deviation, double max_display);
int sender_open_audio(int latspl);
diff --git a/src/libsquelch/squelch.c b/src/libsquelch/squelch.c
index fc05003..10a2ac1 100644
--- a/src/libsquelch/squelch.c
+++ b/src/libsquelch/squelch.c
@@ -22,7 +22,7 @@
#include "../libdebug/debug.h"
#include "squelch.h"
-#define CHAN squelch->chan
+#define CHAN squelch->kanal
/* How does it work:
*
@@ -48,10 +48,10 @@
#define SQUELCH_AUTO_TIME 0.5 /* duration of squelch quelch calibration */
#define SQUELCH_AUTO_OFFSET 10.0 /* auto calibration: offset above noise floor */
-void squelch_init(squelch_t *squelch, int chan, double threshold_db, double mute_time, double loss_time)
+void squelch_init(squelch_t *squelch, const char *kanal, double threshold_db, double mute_time, double loss_time)
{
memset(squelch, 0, sizeof(*squelch));
- squelch->chan = chan;
+ squelch->kanal = kanal;
squelch->threshold_db = threshold_db;
/* wait for init condition */
squelch->init_count = 0.0;
diff --git a/src/libsquelch/squelch.h b/src/libsquelch/squelch.h
index 45de690..8174103 100644
--- a/src/libsquelch/squelch.h
+++ b/src/libsquelch/squelch.h
@@ -1,6 +1,6 @@
typedef struct squelch {
- int chan; /* channel number */
+ const char *kanal; /* channel number */
double threshold_db; /* threshold level to mute or loss of signal */
double init_count; /* duration counter for starting squelch process */
int auto_state; /* set if auto threshold calibration is performed */
@@ -21,6 +21,6 @@ enum squelch_result {
SQUELCH_LOSS,
};
-void squelch_init(squelch_t *squelch, int chan, double threshold_db, double mute_time, double loss_time);
+void squelch_init(squelch_t *squelch, const char *kanal, double threshold_db, double mute_time, double loss_time);
enum squelch_result squelch(squelch_t *squelch, double rf_level_db, double duration);
diff --git a/src/nmt/main.c b/src/nmt/main.c
index e505aed..056ec0e 100644
--- a/src/nmt/main.c
+++ b/src/nmt/main.c
@@ -345,14 +345,14 @@ int main(int argc, char *argv[])
for (i = 0; i < num_kanal; i++) {
if (supervisory[i] == 0) {
- fprintf(stderr, "No supervisory signal given for channel %d. This is ok, but signal loss dannot be detected. \n", kanal[i]);
+ fprintf(stderr, "No supervisory signal given for channel %s. This is ok, but signal loss dannot be detected. \n", kanal[i]);
continue;
}
if (super[supervisory[i]]) {
- fprintf(stderr, "Supervisory signal %d is selected for both cannels #%d and #%d. I advice to use different signal, to avoid co-channel interferences.\n", supervisory[i], kanal[i], super[supervisory[i]]);
+ fprintf(stderr, "Supervisory signal %d is selected for both cannels #%s and #%d. I advice to use different signal, to avoid co-channel interferences.\n", supervisory[i], kanal[i], super[supervisory[i]]);
continue;
}
- super[supervisory[i]] = kanal[i];
+ super[supervisory[i]] = atoi(kanal[i]);
}
}
@@ -402,7 +402,7 @@ int main(int argc, char *argv[])
fprintf(stderr, "Failed to create transceiver instance. Quitting!\n");
goto fail;
}
- printf("base station on channel %d ready, please tune transmitter to %.4f MHz and receiver to %.4f MHz. (%.3f MHz offset)\n", kanal[i], nmt_channel2freq(nmt_system, country, kanal[i], 0, NULL, NULL, NULL) / 1e6, nmt_channel2freq(nmt_system, country, kanal[i], 1, NULL, NULL, NULL) / 1e6, nmt_channel2freq(nmt_system, country, kanal[i], 2, NULL, NULL, NULL) / 1e6);
+ printf("base station on channel %s ready, please tune transmitter to %.4f MHz and receiver to %.4f MHz. (%.3f MHz offset)\n", kanal[i], nmt_channel2freq(nmt_system, country, atoi(kanal[i]), 0, NULL, NULL, NULL) / 1e6, nmt_channel2freq(nmt_system, country, atoi(kanal[i]), 1, NULL, NULL, NULL) / 1e6, nmt_channel2freq(nmt_system, country, atoi(kanal[i]), 2, NULL, NULL, NULL) / 1e6);
}
nmt_check_channels(nmt_system);
diff --git a/src/nmt/nmt.c b/src/nmt/nmt.c
index 944b3a6..3d0f75d 100644
--- a/src/nmt/nmt.c
+++ b/src/nmt/nmt.c
@@ -264,7 +264,7 @@ static inline int is_chan_class_tc(enum nmt_chan_type chan_type)
static void nmt_timeout(struct timer *timer);
/* Create transceiver instance and link to a list. */
-int nmt_create(int nmt_system, const char *country, int channel, enum nmt_chan_type chan_type, 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, uint8_t ms_power, uint8_t traffic_area, uint8_t area_no, int compandor, int supervisory, const char *smsc_number, int send_callerid, int loopback)
+int nmt_create(int nmt_system, const char *country, const char *kanal, enum nmt_chan_type chan_type, 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, uint8_t ms_power, uint8_t traffic_area, uint8_t area_no, int compandor, int supervisory, const char *smsc_number, int send_callerid, int loopback)
{
nmt_t *nmt;
int rc;
@@ -273,8 +273,8 @@ int nmt_create(int nmt_system, const char *country, int channel, enum nmt_chan_t
int tested;
/* check channel matching and set deviation factor */
- if (nmt_channel2freq(nmt_system, country, channel, 0, &deviation_factor, &scandinavia, &tested) == 0.0) {
- PDEBUG(DNMT, DEBUG_NOTICE, "Channel number %d invalid, use '-Y list' to get a list of available channels.\n", channel);
+ if (nmt_channel2freq(nmt_system, country, atoi(kanal), 0, &deviation_factor, &scandinavia, &tested) == 0.0) {
+ PDEBUG(DNMT, DEBUG_NOTICE, "Channel number %s invalid, use '-Y list' to get a list of available channels.\n", kanal);
return -EINVAL;
}
@@ -282,11 +282,11 @@ int nmt_create(int nmt_system, const char *country, int channel, enum nmt_chan_t
PDEBUG(DNMT, DEBUG_NOTICE, "*** The given NMT country has not been tested yet. Please tell the Author, if it works.\n");
}
- if (scandinavia && channel >= 201) {
+ if (scandinavia && atoi(kanal) >= 201) {
PDEBUG(DNMT, DEBUG_NOTICE, "*** Channels numbers above 200 have been specified, but never used. These 'interleaved channels are probably not supports by the phone.\n");
}
- if (scandinavia && channel >= 181 && channel <= 200) {
+ if (scandinavia && atoi(kanal) >= 181 && atoi(kanal) <= 200) {
PDEBUG(DNMT, DEBUG_NOTICE, "Extended channel numbers (181..200) have been specified, but never been supported for sure. There is no phone to test with, so don't use it!\n");
}
@@ -300,10 +300,10 @@ int nmt_create(int nmt_system, const char *country, int channel, enum nmt_chan_t
return -ENOMEM;
}
- PDEBUG(DNMT, DEBUG_DEBUG, "Creating 'NMT' instance for channel = %d (sample rate %d).\n", channel, samplerate);
+ PDEBUG(DNMT, DEBUG_DEBUG, "Creating 'NMT' instance for channel = %s (sample rate %d).\n", kanal, samplerate);
/* init general part of transceiver */
- rc = sender_create(&nmt->sender, channel, nmt_channel2freq(nmt_system, country, channel, 0, NULL, NULL, NULL), nmt_channel2freq(nmt_system, country, channel, 1, NULL, NULL, NULL), audiodev, use_sdr, samplerate, rx_gain, pre_emphasis, de_emphasis, write_rx_wave, write_tx_wave, read_rx_wave, read_tx_wave, loopback, PAGING_SIGNAL_NONE);
+ rc = sender_create(&nmt->sender, kanal, nmt_channel2freq(nmt_system, country, atoi(kanal), 0, NULL, NULL, NULL), nmt_channel2freq(nmt_system, country, atoi(kanal), 1, NULL, NULL, NULL), audiodev, use_sdr, samplerate, rx_gain, pre_emphasis, de_emphasis, write_rx_wave, write_tx_wave, read_rx_wave, read_tx_wave, loopback, PAGING_SIGNAL_NONE);
if (rc < 0) {
PDEBUG(DNMT, DEBUG_ERROR, "Failed to init transceiver process!\n");
goto error;
@@ -344,7 +344,7 @@ int nmt_create(int nmt_system, const char *country, int channel, enum nmt_chan_t
/* go into idle state */
nmt_go_idle(nmt);
- PDEBUG(DNMT, DEBUG_NOTICE, "Created channel #%d of type '%s' = %s\n", channel, chan_type_short_name(nmt_system, chan_type), chan_type_long_name(nmt_system, chan_type));
+ PDEBUG(DNMT, DEBUG_NOTICE, "Created channel #%s of type '%s' = %s\n", kanal, chan_type_short_name(nmt_system, chan_type), chan_type_long_name(nmt_system, chan_type));
if (nmt_long_name_by_short_name(nmt_system, country))
PDEBUG(DNMT, DEBUG_NOTICE, " -> Using country '%s'\n", nmt_long_name_by_short_name(nmt_system, country));
PDEBUG(DNMT, DEBUG_NOTICE, " -> Using traffic area %d,%d and area no %d\n", traffic_area >> 4, (nmt_system == 450) ? nmt_flip_ten((traffic_area & 0xf)) : (traffic_area & 0xf), area_no);
@@ -425,7 +425,7 @@ void nmt_destroy(sender_t *sender)
{
nmt_t *nmt = (nmt_t *) sender;
- PDEBUG(DNMT, DEBUG_DEBUG, "Destroying 'NMT' instance for channel = %d.\n", sender->kanal);
+ PDEBUG(DNMT, DEBUG_DEBUG, "Destroying 'NMT' instance for channel = %s.\n", sender->kanal);
dsp_cleanup_sender(nmt);
dms_cleanup_sender(nmt);
sms_cleanup_sender(nmt);
@@ -489,7 +489,7 @@ static void nmt_page(transaction_t *trans, int try)
/* page on all idle channels and on channels we previously paged */
if (nmt->state != STATE_IDLE && nmt->trans != trans)
continue;
- PDEBUG(DNMT, DEBUG_INFO, "Paging on channel %d.\n", sender->kanal);
+ PDEBUG(DNMT, DEBUG_INFO, "Paging on channel %s.\n", sender->kanal);
nmt->trans = trans; /* add transaction before state change, so status is shown correctly */
nmt_new_state(nmt, STATE_MT_PAGING);
nmt_set_dsp_mode(nmt, DSP_MODE_FRAME);
@@ -536,7 +536,7 @@ static int match_channel(nmt_t *nmt, frame_t *frame)
return 0;
}
/* in case of interleaved channel, ignore the missing upper bit */
- if ((channel % 1024) != (nmt->sender.kanal % 1024)) {
+ if ((channel % 1024) != (atoi(nmt->sender.kanal) % 1024)) {
PDEBUG_CHAN(DNMT, DEBUG_NOTICE, "Frame for different channel %d received, ignoring.\n", channel);
return 0;
}
@@ -594,8 +594,8 @@ static void tx_ident(nmt_t *nmt, frame_t *frame)
transaction_t *trans = nmt->trans;
frame->mt = NMT_MESSAGE_3b;
- frame->channel_no = nmt_encode_channel(nmt->sysinfo.system, nmt->sender.kanal, nmt->sysinfo.ms_power);
- frame->traffic_area = nmt_encode_traffic_area(nmt->sysinfo.system, nmt->sender.kanal, nmt->sysinfo.traffic_area);
+ frame->channel_no = nmt_encode_channel(nmt->sysinfo.system, atoi(nmt->sender.kanal), nmt->sysinfo.ms_power);
+ frame->traffic_area = nmt_encode_traffic_area(nmt->sysinfo.system, atoi(nmt->sender.kanal), nmt->sysinfo.traffic_area);
frame->ms_country = nmt_digits2value(&trans->subscriber.country, 1);
frame->ms_number = nmt_digits2value(trans->subscriber.number, 6);
frame->additional_info = nmt_encode_area_no(nmt->sysinfo.area_no);
@@ -606,8 +606,8 @@ static void set_line_signal(nmt_t *nmt, frame_t *frame, uint8_t signal)
transaction_t *trans = nmt->trans;
frame->mt = NMT_MESSAGE_5a;
- frame->channel_no = nmt_encode_channel(nmt->sysinfo.system, nmt->sender.kanal, nmt->sysinfo.ms_power);
- frame->traffic_area = nmt_encode_traffic_area(nmt->sysinfo.system, nmt->sender.kanal, nmt->sysinfo.traffic_area);
+ frame->channel_no = nmt_encode_channel(nmt->sysinfo.system, atoi(nmt->sender.kanal), nmt->sysinfo.ms_power);
+ frame->traffic_area = nmt_encode_traffic_area(nmt->sysinfo.system, atoi(nmt->sender.kanal), nmt->sysinfo.traffic_area);
frame->ms_country = nmt_digits2value(&trans->subscriber.country, 1);
frame->ms_number = nmt_digits2value(trans->subscriber.number, 6);
frame->line_signal = (signal << 8) | (signal << 4) | signal;
@@ -642,8 +642,8 @@ static void tx_idle(nmt_t *nmt, frame_t *frame)
frame->mt = NMT_MESSAGE_30;
break;
}
- frame->channel_no = nmt_encode_channel(nmt->sysinfo.system, nmt->sender.kanal, nmt->sysinfo.ms_power);
- frame->traffic_area = nmt_encode_traffic_area(nmt->sysinfo.system, nmt->sender.kanal, nmt->sysinfo.traffic_area);
+ frame->channel_no = nmt_encode_channel(nmt->sysinfo.system, atoi(nmt->sender.kanal), nmt->sysinfo.ms_power);
+ frame->traffic_area = nmt_encode_traffic_area(nmt->sysinfo.system, atoi(nmt->sender.kanal), nmt->sysinfo.traffic_area);
frame->additional_info = nmt_encode_area_no(nmt->sysinfo.area_no);
}
@@ -994,8 +994,8 @@ static void tx_mt_paging(nmt_t *nmt, frame_t *frame)
transaction_t *trans = nmt->trans;
frame->mt = NMT_MESSAGE_2a;
- frame->channel_no = nmt_encode_channel(nmt->sysinfo.system, nmt->sender.kanal, nmt->sysinfo.ms_power);
- frame->traffic_area = nmt_encode_traffic_area(nmt->sysinfo.system, nmt->sender.kanal, nmt->sysinfo.traffic_area);
+ frame->channel_no = nmt_encode_channel(nmt->sysinfo.system, atoi(nmt->sender.kanal), nmt->sysinfo.ms_power);
+ frame->traffic_area = nmt_encode_traffic_area(nmt->sysinfo.system, atoi(nmt->sender.kanal), nmt->sysinfo.traffic_area);
frame->ms_country = nmt_digits2value(&trans->subscriber.country, 1);
frame->ms_number = nmt_digits2value(trans->subscriber.number, 6);
frame->additional_info = nmt_encode_area_no(nmt->sysinfo.area_no);
@@ -1071,22 +1071,22 @@ static void tx_mt_channel(nmt_t *nmt, frame_t *frame)
if (nmt != tc) {
/* link trans and tc together, so we can continue with channel assignment */
- PDEBUG_CHAN(DNMT, DEBUG_NOTICE, "Switching to TC channel #%d.\n", tc->sender.kanal);
+ PDEBUG_CHAN(DNMT, DEBUG_NOTICE, "Switching to TC channel #%s.\n", tc->sender.kanal);
nmt_go_idle(nmt);
tc->trans = trans;
trans->nmt = tc;
} else
- PDEBUG_CHAN(DNMT, DEBUG_NOTICE, "Staying on CC/TC channel #%d.\n", tc->sender.kanal);
+ PDEBUG_CHAN(DNMT, DEBUG_NOTICE, "Staying on CC/TC channel #%s.\n", tc->sender.kanal);
nmt_new_state(tc, STATE_MT_IDENT);
tc->tx_frame_count = 0;
/* assign channel on 'nmt' to 'tc' */
frame->mt = NMT_MESSAGE_2b;
- frame->channel_no = nmt_encode_channel(nmt->sysinfo.system, nmt->sender.kanal, nmt->sysinfo.ms_power);
- frame->traffic_area = nmt_encode_traffic_area(nmt->sysinfo.system, nmt->sender.kanal, nmt->sysinfo.traffic_area);
+ frame->channel_no = nmt_encode_channel(nmt->sysinfo.system, atoi(nmt->sender.kanal), nmt->sysinfo.ms_power);
+ frame->traffic_area = nmt_encode_traffic_area(nmt->sysinfo.system, atoi(nmt->sender.kanal), nmt->sysinfo.traffic_area);
frame->ms_country = nmt_digits2value(&trans->subscriber.country, 1);
frame->ms_number = nmt_digits2value(trans->subscriber.number, 6);
- frame->tc_no = nmt_encode_tc(tc->sysinfo.system, tc->sender.kanal, tc->sysinfo.ms_power);
+ frame->tc_no = nmt_encode_tc(tc->sysinfo.system, atoi(tc->sender.kanal), tc->sysinfo.ms_power);
PDEBUG_CHAN(DNMT, DEBUG_INFO, "Send channel activation to mobile.\n");
}
@@ -1203,7 +1203,7 @@ static void tx_mt_ringing(nmt_t *nmt, frame_t *frame)
if (nmt->tx_callerid_count) {
if (nmt->tx_frame_count == 5)
PDEBUG_CHAN(DNMT, DEBUG_INFO, "Send 'A-number'.\n");
- nmt_encode_a_number(frame, nmt->tx_frame_count - 4, trans->caller_type, trans->caller_id, nmt->sysinfo.system, nmt->sender.kanal, nmt->sysinfo.ms_power, nmt->sysinfo.traffic_area);
+ nmt_encode_a_number(frame, nmt->tx_frame_count - 4, trans->caller_type, trans->caller_id, nmt->sysinfo.system, atoi(nmt->sender.kanal), nmt->sysinfo.ms_power, nmt->sysinfo.traffic_area);
} else
frame->mt = NMT_MESSAGE_6;
}
diff --git a/src/nmt/nmt.h b/src/nmt/nmt.h
index 70c8bab..6700b35 100644
--- a/src/nmt/nmt.h
+++ b/src/nmt/nmt.h
@@ -141,7 +141,7 @@ void nmt_channel_list(int nmt_system);
int nmt_channel_by_short_name(int nmt_system, const char *short_name);
const char *chan_type_short_name(int nmt_system, enum nmt_chan_type chan_type);
const char *chan_type_long_name(int nmt_system, enum nmt_chan_type chan_type);
-int nmt_create(int nmt_system, const char *country, int channel, enum nmt_chan_type chan_type, 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, uint8_t ms_power, uint8_t traffic_area, uint8_t area_no, int compandor, int supervisory, const char *smsc_number, int send_callerid, int loopback);
+int nmt_create(int nmt_system, const char *country, const char *kanal, enum nmt_chan_type chan_type, 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, uint8_t ms_power, uint8_t traffic_area, uint8_t area_no, int compandor, int supervisory, const char *smsc_number, int send_callerid, int loopback);
void nmt_check_channels(int nmt_system);
void nmt_destroy(sender_t *sender);
void nmt_go_idle(nmt_t *nmt);
diff --git a/src/r2000/main.c b/src/r2000/main.c
index efce6cb..3b49fd9 100644
--- a/src/r2000/main.c
+++ b/src/r2000/main.c
@@ -357,7 +357,7 @@ int main(int argc, char *argv[])
fprintf(stderr, "Failed to create transceiver instance. Quitting!\n");
goto fail;
}
- printf("base station on channel %d ready, please tune transmitter to %.4f MHz and receiver to %.4f MHz. (%.3f MHz offset)\n", kanal[i], r2000_channel2freq(band, kanal[i], 0) / 1e6, r2000_channel2freq(band, kanal[i], 1) / 1e6, r2000_channel2freq(band, kanal[i], 2) / 1e6);
+ printf("base station on channel %s ready, please tune transmitter to %.4f MHz and receiver to %.4f MHz. (%.3f MHz offset)\n", kanal[i], r2000_channel2freq(band, atoi(kanal[i]), 0) / 1e6, r2000_channel2freq(band, atoi(kanal[i]), 1) / 1e6, r2000_channel2freq(band, atoi(kanal[i]), 2) / 1e6);
nconv = (nconv + 1) & 7;
}
diff --git a/src/r2000/r2000.c b/src/r2000/r2000.c
index a625467..535c0a8 100644
--- a/src/r2000/r2000.c
+++ b/src/r2000/r2000.c
@@ -354,7 +354,7 @@ static int match_voie(r2000_t *r2000, frame_t *frame, uint8_t voie)
static int match_channel(r2000_t *r2000, frame_t *frame)
{
- if (frame->channel != r2000->sender.kanal) {
+ if (frame->channel != atoi(r2000->sender.kanal)) {
PDEBUG_CHAN(DR2000, DEBUG_NOTICE, "Frame for different channel %d received, ignoring.\n", frame->channel);
return 0;
}
@@ -412,14 +412,14 @@ uint8_t r2000_encode_super(r2000_t *r2000)
static void r2000_timeout(struct timer *timer);
/* Create transceiver instance and link to a list. */
-int r2000_create(int band, int channel, enum r2000_chan_type chan_type, 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, uint16_t relais, uint8_t deport, uint8_t agi, uint8_t sm_power, uint8_t taxe, uint8_t crins, int destruction, uint8_t nconv, int recall, int loopback)
+int r2000_create(int band, const char *kanal, enum r2000_chan_type chan_type, 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, uint16_t relais, uint8_t deport, uint8_t agi, uint8_t sm_power, uint8_t taxe, uint8_t crins, int destruction, uint8_t nconv, int recall, int loopback)
{
sender_t *sender;
r2000_t *r2000 = NULL;
int rc;
/* check channel matching and set deviation factor */
- if (r2000_channel2freq(band, channel, 0) == 0.0)
+ if (r2000_channel2freq(band, atoi(kanal), 0) == 0.0)
return -EINVAL;
for (sender = sender_head; sender; sender = sender->next) {
@@ -437,10 +437,10 @@ int r2000_create(int band, int channel, enum r2000_chan_type chan_type, const ch
return -ENOMEM;
}
- PDEBUG(DR2000, DEBUG_DEBUG, "Creating 'Radiocom 2000' instance for channel = %d (sample rate %d).\n", channel, samplerate);
+ PDEBUG(DR2000, DEBUG_DEBUG, "Creating 'Radiocom 2000' instance for channel = %s (sample rate %d).\n", kanal, samplerate);
/* init general part of transceiver */
- rc = sender_create(&r2000->sender, channel, r2000_channel2freq(band, channel, 0), r2000_channel2freq(band, channel, 1), audiodev, use_sdr, samplerate, rx_gain, 0, 0, write_rx_wave, write_tx_wave, read_rx_wave, read_tx_wave, loopback, PAGING_SIGNAL_NONE);
+ rc = sender_create(&r2000->sender, kanal, r2000_channel2freq(band, atoi(kanal), 0), r2000_channel2freq(band, atoi(kanal), 1), audiodev, use_sdr, samplerate, rx_gain, 0, 0, write_rx_wave, write_tx_wave, read_rx_wave, read_tx_wave, loopback, PAGING_SIGNAL_NONE);
if (rc < 0) {
PDEBUG(DR2000, DEBUG_ERROR, "Failed to init transceiver process!\n");
goto error;
@@ -479,7 +479,7 @@ int r2000_create(int band, int channel, enum r2000_chan_type chan_type, const ch
/* go into idle state */
r2000_go_idle(r2000);
- PDEBUG(DR2000, DEBUG_NOTICE, "Created channel #%d of type '%s' = %s\n", channel, chan_type_short_name(chan_type), chan_type_long_name(chan_type));
+ PDEBUG(DR2000, DEBUG_NOTICE, "Created channel #%s of type '%s' = %s\n", kanal, chan_type_short_name(chan_type), chan_type_long_name(chan_type));
return 0;
@@ -528,7 +528,7 @@ void r2000_destroy(sender_t *sender)
{
r2000_t *r2000 = (r2000_t *) sender;
- PDEBUG(DR2000, DEBUG_DEBUG, "Destroying 'Radiocom 2000' instance for channel = %d.\n", sender->kanal);
+ PDEBUG(DR2000, DEBUG_DEBUG, "Destroying 'Radiocom 2000' instance for channel = %s.\n", sender->kanal);
dsp_cleanup_sender(r2000);
timer_exit(&r2000->timer);
sender_destroy(&r2000->sender);
@@ -746,9 +746,9 @@ static void tx_out_assign(r2000_t *r2000, frame_t *frame)
frame->sm_type = r2000->subscriber.type;
frame->sm_relais = r2000->subscriber.relais;
frame->sm_mor = r2000->subscriber.mor;
- frame->chan_assign = tc->sender.kanal;
+ frame->chan_assign = atoi(tc->sender.kanal);
- PDEBUG_CHAN(DR2000, DEBUG_INFO, "Sending outgoing assignment from channel %d to %d\n", r2000->sender.kanal, tc->sender.kanal);
+ PDEBUG_CHAN(DR2000, DEBUG_INFO, "Sending outgoing assignment from channel %s to %s\n", r2000->sender.kanal, tc->sender.kanal);
r2000_new_state(tc, (tc->state == STATE_OUT_ASSIGN) ? STATE_OUT_IDENT : STATE_RECALL_IDENT);
timer_start(&tc->timer, IDENT_TIME);
@@ -773,9 +773,9 @@ static void tx_in_assign(r2000_t *r2000, frame_t *frame)
frame->sm_type = r2000->subscriber.type;
frame->sm_relais = r2000->subscriber.relais;
frame->sm_mor = r2000->subscriber.mor;
- frame->chan_assign = tc->sender.kanal;
+ frame->chan_assign = atoi(tc->sender.kanal);
- PDEBUG_CHAN(DR2000, DEBUG_INFO, "Sending incoming assignment from channel %d to %d\n", r2000->sender.kanal, tc->sender.kanal);
+ PDEBUG_CHAN(DR2000, DEBUG_INFO, "Sending incoming assignment from channel %s to %s\n", r2000->sender.kanal, tc->sender.kanal);
r2000_new_state(tc, STATE_IN_IDENT);
timer_start(&tc->timer, IDENT_TIME);
@@ -1196,7 +1196,7 @@ const char *r2000_get_frame(r2000_t *r2000)
r2000->tx_frame_count++;
memset(&frame, 0, sizeof(frame));
- frame.channel = r2000->sender.kanal;
+ frame.channel = atoi(r2000->sender.kanal);
frame.relais = r2000->sysinfo.relais;
frame.deport = r2000->sysinfo.deport;
frame.agi = r2000->sysinfo.agi;
diff --git a/src/r2000/r2000.h b/src/r2000/r2000.h
index a0dec22..2efd3f3 100644
--- a/src/r2000/r2000.h
+++ b/src/r2000/r2000.h
@@ -121,7 +121,7 @@ void r2000_channel_list(void);
int r2000_channel_by_short_name(const char *short_name);
const char *chan_type_short_name(enum r2000_chan_type chan_type);
const char *chan_type_long_name(enum r2000_chan_type chan_type);
-int r2000_create(int band, int channel, enum r2000_chan_type chan_type, 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, uint16_t relais, uint8_t deport, uint8_t agi, uint8_t sm_power, uint8_t taxe, uint8_t crins, int destruction, uint8_t nconv, int recall, int loopback);
+int r2000_create(int band, const char *kanal, enum r2000_chan_type chan_type, 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, uint16_t relais, uint8_t deport, uint8_t agi, uint8_t sm_power, uint8_t taxe, uint8_t crins, int destruction, uint8_t nconv, int recall, int loopback);
void r2000_check_channels(void);
void r2000_destroy(sender_t *sender);
void r2000_go_idle(r2000_t *r2000);