aboutsummaryrefslogtreecommitdiffstats
path: root/src/bnetz
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2016-03-11 06:59:05 +0100
committerAndreas Eversberg <jolly@eversberg.eu>2016-03-13 09:12:23 +0100
commit0dc81fe21011e813f801742e8ddb61a5212bd626 (patch)
tree6eefc6eb26dba3764f2d9722a37e1a67d9bebd15 /src/bnetz
parent287b914b56d67760f6a056d065754dab0911574e (diff)
Prepare for NMT: Fixes and improvements at common code
Diffstat (limited to 'src/bnetz')
-rw-r--r--src/bnetz/Makefile.am2
-rw-r--r--src/bnetz/ansage-27.h3
-rw-r--r--src/bnetz/ansage.c (renamed from src/bnetz/ansage-27.c)14
-rw-r--r--src/bnetz/ansage.h3
-rw-r--r--src/bnetz/dsp.c6
-rw-r--r--src/bnetz/main.c14
6 files changed, 25 insertions, 17 deletions
diff --git a/src/bnetz/Makefile.am b/src/bnetz/Makefile.am
index b3306ba..8cbe388 100644
--- a/src/bnetz/Makefile.am
+++ b/src/bnetz/Makefile.am
@@ -7,7 +7,7 @@ bnetz_SOURCES = \
bnetz.c \
dsp.c \
image.c \
- ansage-27.c \
+ ansage.c \
main.c
bnetz_LDADD = \
$(COMMON_LA) \
diff --git a/src/bnetz/ansage-27.h b/src/bnetz/ansage-27.h
deleted file mode 100644
index 0684664..0000000
--- a/src/bnetz/ansage-27.h
+++ /dev/null
@@ -1,3 +0,0 @@
-
-void init_ansage_27(void);
-
diff --git a/src/bnetz/ansage-27.c b/src/bnetz/ansage.c
index c44c325..7475198 100644
--- a/src/bnetz/ansage-27.c
+++ b/src/bnetz/ansage.c
@@ -1,5 +1,5 @@
#include <stdint.h>
-#include "ansage-27.h"
+#include "ansage.h"
static int16_t pattern[] = {
0xffd1, 0x0011, 0x0031, 0x002d, 0x0016, 0x000d, 0x002f, 0xffea,
@@ -4991,13 +4991,15 @@ static int16_t pattern[] = {
0x0006, 0x000e, 0xfffd, 0x000b, 0xfffc, 0x000b, 0x000e, 0xfffb,
};
-extern int16_t *ansage_27_spl;
-extern int ansage_27_size;
+extern int16_t *outoforder_spl;
+extern int outoforder_size;
+extern int outoforder_max;
-void init_ansage_27(void)
+void init_ansage(void)
{
- ansage_27_spl = pattern;
- ansage_27_size = sizeof(pattern) / sizeof(pattern[0]);
+ outoforder_spl = pattern;
+ outoforder_size = sizeof(pattern) / sizeof(pattern[0]);
+ outoforder_max = outoforder_size;
}
diff --git a/src/bnetz/ansage.h b/src/bnetz/ansage.h
new file mode 100644
index 0000000..0fede4e
--- /dev/null
+++ b/src/bnetz/ansage.h
@@ -0,0 +1,3 @@
+
+void init_ansage(void);
+
diff --git a/src/bnetz/dsp.c b/src/bnetz/dsp.c
index fb352aa..db339a8 100644
--- a/src/bnetz/dsp.c
+++ b/src/bnetz/dsp.c
@@ -84,13 +84,13 @@ int dsp_init_sender(bnetz_t *bnetz)
PDEBUG(DFSK, DEBUG_DEBUG, "Using %d samples per bit duration.\n", bnetz->samples_per_bit);
bnetz->fsk_filter_step = bnetz->sender.samplerate * FILTER_STEP;
PDEBUG(DFSK, DEBUG_DEBUG, "Using %d samples per filter step.\n", bnetz->fsk_filter_step);
- spl = calloc(16, bnetz->samples_per_bit << 1);
+ spl = calloc(16, bnetz->samples_per_bit * sizeof(*spl));
if (!spl) {
PDEBUG(DFSK, DEBUG_ERROR, "No memory!\n");
return -ENOMEM;
}
bnetz->telegramm_spl = spl;
- spl = calloc(1, bnetz->samples_per_bit << 1);
+ spl = calloc(1, bnetz->samples_per_bit * sizeof(*spl));
if (!spl) {
PDEBUG(DFSK, DEBUG_ERROR, "No memory!\n");
return -ENOMEM;
@@ -204,7 +204,7 @@ char *show_level(int value)
/* Filter one chunk of audio an detect tone, quality and loss of signal.
* The chunk is a window of 10ms. This window slides over audio stream
* and is processed every 1ms. (one step) */
-void fsk_decode_step(bnetz_t *bnetz, int pos)
+static inline void fsk_decode_step(bnetz_t *bnetz, int pos)
{
double level, result[2], softbit, quality;
int max;
diff --git a/src/bnetz/main.c b/src/bnetz/main.c
index 2d7fa53..a788529 100644
--- a/src/bnetz/main.c
+++ b/src/bnetz/main.c
@@ -29,10 +29,12 @@
#include "../common/call.h"
#include "../common/mncc_sock.h"
#include "../common/main.h"
+#include "../common/freiton.h"
+#include "../common/besetztton.h"
#include "bnetz.h"
#include "dsp.h"
#include "image.h"
-#include "ansage-27.h"
+#include "ansage.h"
int gfs = 2;
const char *pilot = "tone";
@@ -40,7 +42,7 @@ double lossdetect = 0;
void print_help(const char *arg0)
{
- print_help_common(arg0);
+ print_help_common(arg0, "");
/* - - */
printf(" -g --gfs <gruppenfreisignal>\n");
printf(" Gruppenfreisignal\" 1..9 | 19 | 10..18 (default = '%d')\n", gfs);
@@ -109,6 +111,11 @@ int main(int argc, char *argv[])
int skip_args;
const char *station_id = "";
+ /* init common tones */
+ init_freiton();
+ init_besetzton();
+ init_ansage();
+
skip_args = handle_options(argc, argv);
argc -= skip_args;
argv += skip_args;
@@ -138,10 +145,9 @@ int main(int argc, char *argv[])
return -1;
}
}
- init_ansage_27();
dsp_init();
bnetz_init();
- rc = call_init(station_id, call_sounddev, samplerate, latency, loopback);
+ rc = call_init(station_id, call_sounddev, samplerate, latency, 5, loopback);
if (rc < 0) {
fprintf(stderr, "Failed to create call control instance. Quitting!\n");
goto fail;