aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2020-05-14 13:28:07 +0200
committerHarald Welte <laforge@osmocom.org>2020-08-03 02:29:21 +0200
commit78861c0aef1859165158e36b808b8c43dc2d38b4 (patch)
treec7659fac5074c1a0d8026cbe524124c62dcdc61b /include
parent95e2dfbc83437ddab54f7882edfd0fe79b767ba9 (diff)
Add new TRAU frame sync code
This code is able to detect and sync against a variety of TRAU frame sync patterns. Focus is so far on those patterns present on 16k sub-slots, but 8k sub-slots are expected to be supported soon, too. A new codebase for this is required as the old OsmoNITB code had conflated a 16k sub-slot multiplexer with TRAU frame synchronization, so there was no way to separate those two parts and hence no way to support 8k sub-slots. Change-Id: Ia6fe6228b0b8b9a27999f37ce1115ed5558881ea
Diffstat (limited to 'include')
-rw-r--r--include/Makefile.am3
-rw-r--r--include/osmocom/trau/trau_sync.h19
2 files changed, 21 insertions, 1 deletions
diff --git a/include/Makefile.am b/include/Makefile.am
index aa735c5..2a99211 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -5,4 +5,5 @@ nobase_include_HEADERS = osmocom/abis/ipa.h osmocom/abis/trau_frame.h \
osmocom/abis/subchan_demux.h osmocom/abis/e1_input.h \
osmocom/abis/lapd.h osmocom/abis/lapd_pcap.h osmocom/trau/osmo_ortp.h \
osmocom/abis/unixsocket_proto.h \
- osmocom/trau/trau_frame.h
+ osmocom/trau/trau_frame.h \
+ osmocom/trau/trau_sync.h
diff --git a/include/osmocom/trau/trau_sync.h b/include/osmocom/trau/trau_sync.h
new file mode 100644
index 0000000..46595be
--- /dev/null
+++ b/include/osmocom/trau/trau_sync.h
@@ -0,0 +1,19 @@
+#pragma once
+#include <osmocom/core/bits.h>
+#include <osmocom/core/fsm.h>
+
+enum osmo_tray_sync_pat_id {
+ OSMO_TRAU_SYNCP_16_FR_EFR,
+ OSMO_TRAU_SYNCP_8_HR,
+ OSMO_TRAU_SYNCP_8_AMR_LOW,
+ OSMO_TRAU_SYNCP_8_AMR_6K7,
+ OSMO_TRAU_SYNCP_8_AMR_7K4,
+};
+
+typedef void (*frame_out_cb_t)(void *user_data, const ubit_t *bits, unsigned int num_bits);
+
+struct osmo_fsm_inst *
+osmo_trau_sync_alloc(void *ctx, const char *name, frame_out_cb_t frame_out_cb,
+ enum osmo_tray_sync_pat_id pat_id, void *user_data);
+
+void osmo_trau_sync_rx_ubits(struct osmo_fsm_inst *fi, const ubit_t *bits, size_t n_bits);