aboutsummaryrefslogtreecommitdiffstats
path: root/src/jolly
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2019-07-20 18:11:17 +0200
committerAndreas Eversberg <jolly@eversberg.eu>2019-08-26 21:10:20 +0200
commitd6579c124424532b9550c02d712c0d01a7da5114 (patch)
tree855f40b807eb09b2f4da969e36e2b82287c063b3 /src/jolly
parentb266b0f743282dd659f7423a2d441208cc7494fc (diff)
Allow giving alphanumeric channels (Prepare for IMTS)
Diffstat (limited to 'src/jolly')
-rw-r--r--src/jolly/jolly.c16
-rw-r--r--src/jolly/jolly.h2
-rw-r--r--src/jolly/main.c2
3 files changed, 10 insertions, 10 deletions
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);