<p>laforge <strong>submitted</strong> this change.</p><p><a href="https://gerrit.osmocom.org/c/libosmo-abis/+/19547">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">trau_sync: make sync pattern configurable<br><br>When a trau sync fsm is allocated, the user must set the sync pattern,<br>which can not be changed during the whole fsm lifecycle. However on<br>codec changes it might be necessary to change the sync pattern on the<br>fly.<br><br>- Add function to change the sync pattern<br><br>Change-Id: I1caff93b4c8eace8ba8cd6e32e996a9e1503232b<br>Related: OS#2659<br>---<br>M include/osmocom/trau/trau_sync.h<br>M src/trau/trau_sync.c<br>2 files changed, 9 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/include/osmocom/trau/trau_sync.h b/include/osmocom/trau/trau_sync.h</span><br><span>index 46595be..bd99586 100644</span><br><span>--- a/include/osmocom/trau/trau_sync.h</span><br><span>+++ b/include/osmocom/trau/trau_sync.h</span><br><span>@@ -17,3 +17,4 @@</span><br><span>                  enum osmo_tray_sync_pat_id pat_id, void *user_data);</span><br><span> </span><br><span> void osmo_trau_sync_rx_ubits(struct osmo_fsm_inst *fi, const ubit_t *bits, size_t n_bits);</span><br><span style="color: hsl(120, 100%, 40%);">+void osmo_trau_sync_set_pat(struct osmo_fsm_inst *fi, enum osmo_tray_sync_pat_id pat_id);</span><br><span>diff --git a/src/trau/trau_sync.c b/src/trau/trau_sync.c</span><br><span>index 730cf0c..89c5558 100644</span><br><span>--- a/src/trau/trau_sync.c</span><br><span>+++ b/src/trau/trau_sync.c</span><br><span>@@ -499,7 +499,6 @@</span><br><span> </span><br><span>        tss->out_cb = frame_out_cb;</span><br><span>       tss->user_data = user_data;</span><br><span style="color: hsl(0, 100%, 40%);">-  /* FIXME: this must be configurable */</span><br><span>       tss->pattern = &sync_patterns[pat_id];</span><br><span> </span><br><span>    /* An unusued E1 timeslot normally would send an idle signal that</span><br><span>@@ -511,6 +510,14 @@</span><br><span>     return fi;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+void osmo_trau_sync_set_pat(struct osmo_fsm_inst *fi, enum osmo_tray_sync_pat_id pat_id)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+      struct trau_rx_sync_state *tss = fi->priv;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+       tss->pattern = &sync_patterns[pat_id];</span><br><span style="color: hsl(120, 100%, 40%);">+ osmo_fsm_inst_state_chg(fi, FRAME_ALIGNMENT_LOST, 0, 0);</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> void osmo_trau_sync_rx_ubits(struct osmo_fsm_inst *fi, const ubit_t *bits, size_t n_bits)</span><br><span> {</span><br><span>      struct ubit_buf ubb;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmo-abis/+/19547">change 19547</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/libosmo-abis/+/19547"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmo-abis </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I1caff93b4c8eace8ba8cd6e32e996a9e1503232b </div>
<div style="display:none"> Gerrit-Change-Number: 19547 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: dexter <pmaier@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>