Change in osmo-pcu[master]: encoding: Encode TA in UL ACK/NACK if available

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

pespin gerrit-no-reply at lists.osmocom.org
Tue May 11 11:25:56 UTC 2021


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-pcu/+/24203 )


Change subject: encoding: Encode TA in UL ACK/NACK if available
......................................................................

encoding: Encode TA in UL ACK/NACK if available

Change-Id: I3b060ee16aeac5f5d9b314b6bc46383f5e9c44c3
---
M src/encoding.cpp
M tests/tbf/TbfTest.cpp
2 files changed, 23 insertions(+), 6 deletions(-)



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

diff --git a/src/encoding.cpp b/src/encoding.cpp
index 22da6ab..0a4050f 100644
--- a/src/encoding.cpp
+++ b/src/encoding.cpp
@@ -897,7 +897,15 @@
 		bitvec_write_field(dest, &wp, 0, 1); // 0: don't have CONTENTION_RESOLUTION_TLLI
 	}
 
-	bitvec_write_field(dest, &wp, 0, 1); // 0: don't have Packet Timing Advance
+	if (gsm48_ta_is_valid(tbf->ta())) {
+		bitvec_write_field(dest, &wp, 1, 1); // 1: have Packet Timing Advance IE (TS 44.060 12.12)
+		bitvec_write_field(dest, &wp, 1, 1); // 1: have TIMING_ADVANCE_VALUE
+		bitvec_write_field(dest, &wp, tbf->ta(), 6); // TIMING_ADVANCE_VALUE
+		bitvec_write_field(dest, &wp, 0, 1); // 0: don't have TIMING_ADVANCE_INDEX
+	} else {
+		bitvec_write_field(dest, &wp, 0, 1); // 0: don't have Packet Timing Advance
+	}
+
 	bitvec_write_field(dest, &wp, 0, 1); // 0: don't have Power Control Parameters
 	bitvec_write_field(dest, &wp, 0, 1); // 0: don't have Extension Bits
 	bitvec_write_field(dest, &wp, 0, 1); // fixed 0
@@ -1085,7 +1093,16 @@
 	}
 
 	bitvec_write_field(dest, &wp, 1, 1); // TBF_EST (enabled)
-	bitvec_write_field(dest, &wp, 0, 1); // 0: don't have Packet Timing Advance
+
+	if (gsm48_ta_is_valid(tbf->ta())) {
+		bitvec_write_field(dest, &wp, 1, 1); // 1: have Packet Timing Advance IE (TS 44.060 12.12)
+		bitvec_write_field(dest, &wp, 1, 1); // 1: have TIMING_ADVANCE_VALUE
+		bitvec_write_field(dest, &wp, tbf->ta(), 6); // TIMING_ADVANCE_VALUE
+		bitvec_write_field(dest, &wp, 0, 1); // 0: don't have TIMING_ADVANCE_INDEX
+	} else {
+		bitvec_write_field(dest, &wp, 0, 1); // 0: don't have Packet Timing Advance
+	}
+
 	bitvec_write_field(dest, &wp, 0, 1); // 0: don't have Packet Extended Timing Advance
 	bitvec_write_field(dest, &wp, 0, 1); // 0: don't have Power Control Parameters
 	bitvec_write_field(dest, &wp, 0, 1); // 0: don't have Extension Bits
diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp
index e0fd9cc..18a0a37 100644
--- a/tests/tbf/TbfTest.cpp
+++ b/tests/tbf/TbfTest.cpp
@@ -794,8 +794,8 @@
 
 	struct msgb *msg1 = ul_tbf->create_ul_ack(*fn, ts_no);
 
-	static uint8_t exp1[] = { 0x40, 0x24, 0x01, 0x0b, 0x3e, 0x24, 0x46, 0x68, 0x90, 0x87, 0xb0, 0x06,
-				  0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b
+	static uint8_t exp1[] = { 0x40, 0x24, 0x01, 0x0b, 0x3e, 0x24, 0x46, 0x68, 0x9c, 0x70, 0x87, 0xb0,
+				  0x06, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b
 	};
 
 	if (!msgb_eq_data_print(msg1, exp1, GSM_MACBLOCK_LEN)) {
@@ -821,8 +821,8 @@
 
 	msg1 = ul_tbf->create_ul_ack(*fn, ts_no);
 
-	static uint8_t exp2[] = { 0x40, 0x24, 0x01, 0x0b, 0x3e, 0x24, 0x46, 0x68, 0x90, 0x88, 0xb0, 0x06, 0x8b,
-				  0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b
+	static uint8_t exp2[] = { 0x40, 0x24, 0x01, 0x0b, 0x3e, 0x24, 0x46, 0x68, 0x9c, 0x70, 0x88, 0xb0,
+				  0x06, 0x8b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b
 	};
 
 	if (!msgb_eq_data_print(msg1, exp2, GSM_MACBLOCK_LEN)) {

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/24203
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: I3b060ee16aeac5f5d9b314b6bc46383f5e9c44c3
Gerrit-Change-Number: 24203
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210511/6f7eeddf/attachment.htm>


More information about the gerrit-log mailing list