<p>dexter has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/15574">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">ecu_fr: remove osmo_ecu_fr function prototypes from ecu.h<br><br>The specific ECU implementation should not be reachable from outside.<br>Remove those prototypes from ecu.h and use the ecu abstration api to<br>carry out the unit-tests<br><br>Change-Id: Ib0c8a9b164f14ea4fa00688f760a76cdb4890af4<br>---<br>M include/osmocom/codec/ecu.h<br>M tests/codec/codec_ecu_fr_test.c<br>2 files changed, 6 insertions(+), 7 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/74/15574/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/include/osmocom/codec/ecu.h b/include/osmocom/codec/ecu.h</span><br><span>index 927ca0d..15f2ccb 100644</span><br><span>--- a/include/osmocom/codec/ecu.h</span><br><span>+++ b/include/osmocom/codec/ecu.h</span><br><span>@@ -11,9 +11,6 @@</span><br><span>     uint8_t frame_backup[GSM_FR_BYTES];</span><br><span> };</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-void osmo_ecu_fr_reset(struct osmo_ecu_fr_state *state, const uint8_t *frame);</span><br><span style="color: hsl(0, 100%, 40%);">-int osmo_ecu_fr_conceal(struct osmo_ecu_fr_state *state, uint8_t *frame);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span> enum osmo_ecu_codec {</span><br><span>        OSMO_ECU_CODEC_HR,</span><br><span>   OSMO_ECU_CODEC_FR,</span><br><span>diff --git a/tests/codec/codec_ecu_fr_test.c b/tests/codec/codec_ecu_fr_test.c</span><br><span>index 7ebc558..ff57902 100644</span><br><span>--- a/tests/codec/codec_ecu_fr_test.c</span><br><span>+++ b/tests/codec/codec_ecu_fr_test.c</span><br><span>@@ -145,7 +145,7 @@</span><br><span> /* Simulate a real life situation: voice frames with a few dropouts */</span><br><span> void test_fr_concealment_realistic()</span><br><span> {</span><br><span style="color: hsl(0, 100%, 40%);">-        struct osmo_ecu_fr_state state;</span><br><span style="color: hsl(120, 100%, 40%);">+       struct osmo_ecu_state *state = osmo_ecu_init(NULL, OSMO_ECU_CODEC_FR);</span><br><span>       uint8_t frame[GSM_FR_BYTES];</span><br><span>         unsigned int frame_len;</span><br><span>      int rc, i = 0;</span><br><span>@@ -161,12 +161,12 @@</span><br><span>               if (frame_len == GSM_FR_BYTES) {</span><br><span>                     printf(" * input:  %s\n", fr_frames_hex[i]);</span><br><span>                       osmo_hexparse(fr_frames_hex[i], frame, GSM_FR_BYTES);</span><br><span style="color: hsl(0, 100%, 40%);">-                   osmo_ecu_fr_reset(&state, frame);</span><br><span style="color: hsl(120, 100%, 40%);">+                 osmo_ecu_frame_in(state, false, frame, GSM_FR_BYTES);</span><br><span>                } else {</span><br><span>                     printf(" * input:  (bad)\n");</span><br><span>                      memset(frame, 0x00, GSM_FR_BYTES);</span><br><span style="color: hsl(0, 100%, 40%);">-                      rc = osmo_ecu_fr_conceal(&state, frame);</span><br><span style="color: hsl(0, 100%, 40%);">-                    OSMO_ASSERT(rc == 0);</span><br><span style="color: hsl(120, 100%, 40%);">+                 rc = osmo_ecu_frame_out(state, frame);</span><br><span style="color: hsl(120, 100%, 40%);">+                        OSMO_ASSERT(rc == GSM_FR_BYTES);</span><br><span>             }</span><br><span> </span><br><span>                /* Print result */</span><br><span>@@ -176,6 +176,8 @@</span><br><span>             /* Go to the next frame */</span><br><span>           i++;</span><br><span>         }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   osmo_ecu_destroy(state);</span><br><span> }</span><br><span> </span><br><span> /* Simulate a real life situation: voice frames with a few dropouts, using generic core */</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmocore/+/15574">change 15574</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/libosmocore/+/15574"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmocore </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Ib0c8a9b164f14ea4fa00688f760a76cdb4890af4 </div>
<div style="display:none"> Gerrit-Change-Number: 15574 </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-MessageType: newchange </div>