<p>laforge <strong>merged</strong> this change.</p><p><a href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15409">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved
  osmith: Looks good to me, but someone else must approve
  pespin: Looks good to me, but someone else must approve

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">library/PCUIF_Types.ttcn: inform RAW codec about PADDING in PCUIF_data<br><br>PADDING is one of the TITAN specific language extensions [1], which<br>tells the RAW codec that an encoded payload shall end at a boundary<br>fixed by a multiple of 'padding' unit bits counted from the<br>beginning of the message.<br><br>Let's use it for record 'PCUIF_data', where the fixed-size buffer<br>is located in between the other fields, so padding will be ignored<br>by the RAW coding after decoding:<br><br>  $HOST: dec_PCUIF_Message(): Decoded @PCUIF_Types.PCUIF_Message: {<br>    msg_type := PCU_IF_MSG_DATA_REQ (0),<br>    bts_nr := 0, spare := '0000'O,<br>    u := {<br>      data_req := {<br>        sapi := PCU_IF_SAPI_AGCH (2),<br>     len := 23,<br>    data := '2D063F100FE3673A096B0000C800300B2B2B2B2B2B2B2B',<br>     ...<br>      }<br>    }<br>  }<br><br>As a result, we don't have to deal with padding manually and<br>can safely use 'decmatch' statement in the receive templates.<br><br>[1] usrguide/referenceguide/4-ttcn3_language_extensions.adoc<br><br>Change-Id: I5808954b5c67c3239e795e43ae77035152d359ef<br>---<br>M library/PCUIF_Types.ttcn<br>1 file changed, 7 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/library/PCUIF_Types.ttcn b/library/PCUIF_Types.ttcn</span><br><span>index 132b72d..551081b 100644</span><br><span>--- a/library/PCUIF_Types.ttcn</span><br><span>+++ b/library/PCUIF_Types.ttcn</span><br><span>@@ -76,10 +76,15 @@</span><br><span>      PCUIF_Text      text</span><br><span> } with { variant "" };</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/* This is a bad side of the current protocol design: fixed-size buffer is located</span><br><span style="color: hsl(120, 100%, 40%);">+ * in between the other fields of the message, so if the payload is smaller than</span><br><span style="color: hsl(120, 100%, 40%);">+ * 162 octets (1296 bits), we need to fill the remaining space with padding. */</span><br><span style="color: hsl(120, 100%, 40%);">+type octetstring PCUIF_DataPad with { variant "ALIGN(left), PADDING(1296)" };</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> type record PCUIF_data {</span><br><span>   PCUIF_Sapi      sapi,</span><br><span>        uint8_t         len,</span><br><span style="color: hsl(0, 100%, 40%);">-    octetstring     data length(162),</span><br><span style="color: hsl(120, 100%, 40%);">+     PCUIF_DataPad   data,</span><br><span>        uint32_t        fn,</span><br><span>  uint16_t        arfcn,</span><br><span>       uint8_t         trx_nr,</span><br><span>@@ -89,7 +94,7 @@</span><br><span>  uint16_t        ber10k,</span><br><span>      int16_t         ta_offs_qbits,</span><br><span>       int16_t         lqual_cb</span><br><span style="color: hsl(0, 100%, 40%);">-} with { variant (data) "FIELDLENGTH(162), ALIGN(left)" };</span><br><span style="color: hsl(120, 100%, 40%);">+} with { variant (len) "LENGTHTO(data)" };</span><br><span> </span><br><span> type record PCUIF_data_cnf_dt {</span><br><span>    PCUIF_Sapi      sapi,</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15409">change 15409</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/osmo-ttcn3-hacks/+/15409"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-ttcn3-hacks </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I5808954b5c67c3239e795e43ae77035152d359ef </div>
<div style="display:none"> Gerrit-Change-Number: 15409 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: fixeria <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: fixeria <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: osmith <osmith@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>