aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2020-07-31 20:01:42 +0200
committerHarald Welte <laforge@osmocom.org>2020-08-03 02:57:37 +0200
commit8eae96fab3422eced0999dd2bd131ef79bf461d2 (patch)
tree4d35fe68b948a83448d46c318007be09b192963d
parent78861c0aef1859165158e36b808b8c43dc2d38b4 (diff)
trau_sync: prevent false positive synchronization on startup
The history buffer is filled with zeros on startup. Together with incoming bits those may appear as a valid signal. (each trau frame begins with 16 zeros). In order to prevent this lets set the history buffer to all ones, so that it looks like the data in the history buffer is from an unused timeslot. Change-Id: Ie5cc7b9a1ab3d8940ef9d2147f5999e8d09ee40e Related: OS#2547
-rw-r--r--src/trau/trau_sync.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/trau/trau_sync.c b/src/trau/trau_sync.c
index c4baad6..dfd7ce4 100644
--- a/src/trau/trau_sync.c
+++ b/src/trau/trau_sync.c
@@ -502,6 +502,12 @@ osmo_trau_sync_alloc(void *ctx, const char *name, frame_out_cb_t frame_out_cb,
/* FIXME: this must be configurable */
tss->pattern = &sync_patterns[pat_id];
+ /* An unusued E1 timeslot normally would send an idle signal that
+ * has all bits set to one. In order to prevent false-positive
+ * synchronization on startup we set all history bits to 1, to make
+ * it look like a signal from an unused timeslot. */
+ memset(tss->history, 1, sizeof(tss->history));
+
return fi;
}