aboutsummaryrefslogtreecommitdiffstats
path: root/src/bnetz
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2016-04-23 18:50:11 +0200
committerAndreas Eversberg <jolly@eversberg.eu>2016-04-24 15:14:56 +0200
commit4356c93afa77734ce880651a2b0333378267e165 (patch)
tree8ead169110de367bba3e009fff322574246763d2 /src/bnetz
parent5062628e52a1a4d60d4b76266c1cfdb42c529e87 (diff)
common: Add pre and de emphasis, if the radio does not support it
Connect to the oscillator of the transmitter - good girl! You need to enable pre emphasis in this case. Connect to the discriminator of the receiver - good boy! You need to enable de emphasis in this case.
Diffstat (limited to 'src/bnetz')
-rw-r--r--src/bnetz/bnetz.c4
-rw-r--r--src/bnetz/bnetz.h2
-rw-r--r--src/bnetz/main.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/src/bnetz/bnetz.c b/src/bnetz/bnetz.c
index fc4b113..80701db 100644
--- a/src/bnetz/bnetz.c
+++ b/src/bnetz/bnetz.c
@@ -242,7 +242,7 @@ 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(const char *sounddev, int samplerate, const char *write_wave, const char *read_wave, int kanal, int gfs, int loopback, double loss_factor, const char *pilot)
+int bnetz_create(const char *sounddev, int samplerate, int pre_emphasis, int de_emphasis, const char *write_wave, const char *read_wave, int kanal, int gfs, int loopback, double loss_factor, const char *pilot)
{
bnetz_t *bnetz;
int use_pilot_tone = -1;
@@ -300,7 +300,7 @@ error_pilot:
PDEBUG(DBNETZ, DEBUG_DEBUG, "Creating 'B-Netz' instance for 'Kanal' = %d 'Gruppenfreisignal' = %d (sample rate %d).\n", kanal, gfs, samplerate);
/* init general part of transceiver */
- rc = sender_create(&bnetz->sender, sounddev, samplerate, write_wave, read_wave, kanal, loopback, loss_factor, use_pilot_tone);
+ rc = sender_create(&bnetz->sender, sounddev, samplerate, pre_emphasis, de_emphasis, write_wave, read_wave, kanal, loopback, loss_factor, use_pilot_tone);
if (rc < 0) {
PDEBUG(DBNETZ, DEBUG_ERROR, "Failed to init transceiver process!\n");
goto error;
diff --git a/src/bnetz/bnetz.h b/src/bnetz/bnetz.h
index 1d9ddd3..27b7333 100644
--- a/src/bnetz/bnetz.h
+++ b/src/bnetz/bnetz.h
@@ -90,7 +90,7 @@ typedef struct bnetz {
double bnetz_kanal2freq(int kanal, int unterband);
int bnetz_init(void);
-int bnetz_create(const char *sounddev, int samplerate, const char *write_wave, const char *read_wave, int kanal, int gfs, int loopback, double loss_volume, const char *pilot);
+int bnetz_create(const char *sounddev, int samplerate, int pre_emphasis, int de_emphasis, const char *write_wave, const char *read_wave, int kanal, int gfs, int loopback, double loss_volume, const char *pilot);
void bnetz_destroy(sender_t *sender);
void bnetz_loss_indication(bnetz_t *bnetz);
void bnetz_receive_tone(bnetz_t *bnetz, int bit);
diff --git a/src/bnetz/main.c b/src/bnetz/main.c
index fe0c5b5..e871f27 100644
--- a/src/bnetz/main.c
+++ b/src/bnetz/main.c
@@ -154,7 +154,7 @@ int main(int argc, char *argv[])
}
/* create transceiver instance */
- rc = bnetz_create(sounddev, samplerate, write_wave, read_wave, kanal, gfs, loopback, (double)lossdetect / 100.0, pilot);
+ rc = bnetz_create(sounddev, samplerate, do_pre_emphasis, do_de_emphasis, write_wave, read_wave, kanal, gfs, loopback, (double)lossdetect / 100.0, pilot);
if (rc < 0) {
fprintf(stderr, "Failed to create \"Sender\" instance. Quitting!\n");
goto fail;