Change in libosmo-abis[master]: trau_sync: make sync pattern configurable

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Sat Aug 8 08:20:52 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/19547 )

Change subject: trau_sync: make sync pattern configurable
......................................................................

trau_sync: make sync pattern configurable

When a trau sync fsm is allocated, the user must set the sync pattern,
which can not be changed during the whole fsm lifecycle. However on
codec changes it might be necessary to change the sync pattern on the
fly.

- Add function to change the sync pattern

Change-Id: I1caff93b4c8eace8ba8cd6e32e996a9e1503232b
Related: OS#2659
---
M include/osmocom/trau/trau_sync.h
M src/trau/trau_sync.c
2 files changed, 9 insertions(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/include/osmocom/trau/trau_sync.h b/include/osmocom/trau/trau_sync.h
index 46595be..bd99586 100644
--- a/include/osmocom/trau/trau_sync.h
+++ b/include/osmocom/trau/trau_sync.h
@@ -17,3 +17,4 @@
 		     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);
+void osmo_trau_sync_set_pat(struct osmo_fsm_inst *fi, enum osmo_tray_sync_pat_id pat_id);
diff --git a/src/trau/trau_sync.c b/src/trau/trau_sync.c
index 730cf0c..89c5558 100644
--- a/src/trau/trau_sync.c
+++ b/src/trau/trau_sync.c
@@ -499,7 +499,6 @@
 
 	tss->out_cb = frame_out_cb;
 	tss->user_data = user_data;
-	/* FIXME: this must be configurable */
 	tss->pattern = &sync_patterns[pat_id];
 
 	/* An unusued E1 timeslot normally would send an idle signal that
@@ -511,6 +510,14 @@
 	return fi;
 }
 
+void osmo_trau_sync_set_pat(struct osmo_fsm_inst *fi, enum osmo_tray_sync_pat_id pat_id)
+{
+	struct trau_rx_sync_state *tss = fi->priv;
+
+	tss->pattern = &sync_patterns[pat_id];
+	osmo_fsm_inst_state_chg(fi, FRAME_ALIGNMENT_LOST, 0, 0);
+}
+
 void osmo_trau_sync_rx_ubits(struct osmo_fsm_inst *fi, const ubit_t *bits, size_t n_bits)
 {
 	struct ubit_buf ubb;

-- 
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/19547
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: I1caff93b4c8eace8ba8cd6e32e996a9e1503232b
Gerrit-Change-Number: 19547
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200808/53f4669d/attachment.htm>


More information about the gerrit-log mailing list