<p>Vadim Yanitskiy has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/14073">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">library/PCUIF_Types.ttcn: add explicit ALIGN(left) attribute<br><br>In the documentation of Eclipse Titan compiler before [1] it was clearly<br>stated that if the length of the actual value can be determined and it<br>is less than the specified FIELDLENGTH, the remaining bits / bytes will<br>be padded with zeros. The attribute ALIGN specifies the sequence of the<br>actual value and the padding within the encoded field:<br><br>  Attribute syntax: ALIGN(<parameter>);<br>  Parameters allowed: left, right;<br>  Default value: 'right'.<br><br>Since [1], the default value is:<br><br>  'left' for octetstrings, 'right' for all other types.<br><br>[1] https://github.com/eclipse/titan.core/commit/3cbafbd31d5f79049afbf69f8dcba0b94cbf20b2<br><br>In the most 'BTS_Tests.TC_pcu_*', including both 'TC_pcu_data_req_agch'<br>and 'TC_pcu_data_req_imm_ass_pch' we do pass the payload of length 23<br>bytes to ts_PCUIF_DATA_REQ(), what is less than the actual field length<br>(162 bytes). Thus when using titan.core <= 6.5.3, the payload appears<br>at the end of the buffer on the BTS side, so it reads 23 zero-bytes<br>from the beginning and does transmit them.<br><br>Let's explicitly add ALIGN(left) to field 'data' of 'PCUIF_data', so<br>the alignment would be done correctly, as expected by the BTS. Let's<br>also drop 'OCT162' type, as it doesn't make sense outside the<br>message definition.<br><br>This change makes the following test cases pass:<br><br>  - 'TC_pcu_data_req_agch' and<br>  - 'TC_pcu_data_req_imm_ass_pch'.<br><br>Change-Id: Ic4f358e5053e30e0dd7be8b6ac9c1d86cf9d8065<br>---<br>M library/PCUIF_Types.ttcn<br>1 file changed, 4 insertions(+), 6 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/73/14073/1</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 17adbd1..750e0b4 100644</span><br><span>--- a/library/PCUIF_Types.ttcn</span><br><span>+++ b/library/PCUIF_Types.ttcn</span><br><span>@@ -67,12 +67,10 @@</span><br><span>      PCUIF_Text      text</span><br><span> } with { variant "" };</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-type octetstring OCT162 length(162) with { variant "FIELDLENGTH(162)" };</span><br><span style="color: hsl(0, 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%);">-    OCT162          data,</span><br><span style="color: hsl(120, 100%, 40%);">+ octetstring     data length(162),</span><br><span>    uint32_t        fn,</span><br><span>  uint16_t        arfcn,</span><br><span>       uint8_t         trx_nr,</span><br><span>@@ -82,7 +80,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 "" };</span><br><span style="color: hsl(120, 100%, 40%);">+} with { variant (data) "FIELDLENGTH(162), ALIGN(left)" };</span><br><span> </span><br><span> type record PCUIF_data_cnf_dt {</span><br><span>        PCUIF_Sapi      sapi,</span><br><span>@@ -373,7 +371,7 @@</span><br><span>                                           template (value) uint8_t ts_nr,</span><br><span>                                              template (value) uint8_t block_nr,</span><br><span>                                           template (value) PCUIF_Sapi sapi,</span><br><span style="color: hsl(0, 100%, 40%);">-                                               template (value) OCT162 data,</span><br><span style="color: hsl(120, 100%, 40%);">+                                                 template (value) octetstring data,</span><br><span>                                           template (value) uint32_t fn,</span><br><span>                                                template (value) uint16_t arfcn,</span><br><span>                                             template (value) int8_t rssi := -80,</span><br><span>@@ -405,7 +403,7 @@</span><br><span>                                   template uint8_t ts_nr := ?,</span><br><span>                                         template uint8_t block_nr := ?,</span><br><span>                                      template PCUIF_Sapi sapi := ?,</span><br><span style="color: hsl(0, 100%, 40%);">-                                  template OCT162 data := ?) := {</span><br><span style="color: hsl(120, 100%, 40%);">+                                       template octetstring data := ?) := {</span><br><span>        msg_type := PCU_IF_MSG_DATA_IND,</span><br><span>     bts_nr := bts_nr,</span><br><span>    spare := ?,</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/14073">change 14073</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/14073"/><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-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ic4f358e5053e30e0dd7be8b6ac9c1d86cf9d8065 </div>
<div style="display:none"> Gerrit-Change-Number: 14073 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Vadim Yanitskiy <axilirator@gmail.com> </div>