Max has uploaded this change for review. ( https://gerrit.osmocom.org/13238


Change subject: Fix TA index encoder
......................................................................

Fix TA index encoder

The TAI is described as { 0 | 1 < TIMING_ADVANCE_INDEX : bit (4) > } in
3GPP TS 44.018 ยง10.5.2.16.1 so it should be encoded with if-else.

Change-Id: I54482790e1cf3cb13a635a99a481250576deabaf
---
M src/encoding.cpp
1 file changed, 6 insertions(+), 6 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/38/13238/1

diff --git a/src/encoding.cpp b/src/encoding.cpp
index e81ff42..55838fb 100644
--- a/src/encoding.cpp
+++ b/src/encoding.cpp
@@ -117,13 +117,13 @@
 {
        int rc;

-       if (tai < 0) /* No TIMING_ADVANCE_INDEX: */
+       if (tai < 0) { /* No TIMING_ADVANCE_INDEX: */
                SET_0(dest);
-
-       /* TIMING_ADVANCE_INDEX: */
-       SET_1(dest);
-       rc = bitvec_set_u64(dest, tai, 4, false);
-       CHECK(rc);
+       } else { /* TIMING_ADVANCE_INDEX: */
+               SET_1(dest);
+               rc = bitvec_set_u64(dest, tai, 4, false);
+               CHECK(rc);
+       }

        return 0;
 }

--
To view, visit https://gerrit.osmocom.org/13238
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I54482790e1cf3cb13a635a99a481250576deabaf
Gerrit-Change-Number: 13238
Gerrit-PatchSet: 1
Gerrit-Owner: Max <msur...@sysmocom.de>

Reply via email to