diff --git a/src/encoding.cpp b/src/encoding.cpp index 55838fb5..b460d41c 100644 --- a/src/encoding.cpp +++ b/src/encoding.cpp @@ -263,7 +263,7 @@ static int write_ia_rest_uplink_sba(bitvec *dest, uint32_t fn, uint8_t alpha, ui } static int write_ia_rest_uplink_mba(const gprs_rlcmac_ul_tbf *tbf, bitvec *dest, uint8_t usf, - uint8_t alpha, uint8_t gamma) + uint8_t alpha, uint8_t gamma, int8_t ta_idx) { int rc = 0; @@ -282,8 +282,8 @@ static int write_ia_rest_uplink_mba(const gprs_rlcmac_ul_tbf *tbf, bitvec *dest, rc = write_alpha_gamma(dest, alpha, gamma); CHECK(rc); - /* No TIMING_ADVANCE_INDEX */ - SET_0(dest); + rc = write_ta_index(dest, ta_idx); + CHECK(rc); /* No TBF_STARTING_TIME */ SET_0(dest); @@ -311,7 +311,7 @@ static int write_ia_rest_egprs_uplink_mba(bitvec * dest, uint32_t fn, uint8_t al } static int write_ia_rest_egprs_uplink_sba(const gprs_rlcmac_ul_tbf *tbf, bitvec * dest, uint8_t usf, - uint8_t alpha, uint8_t gamma) + uint8_t alpha, uint8_t gamma, int8_t ta_idx) { int rc = 0; @@ -339,8 +339,8 @@ static int write_ia_rest_egprs_uplink_sba(const gprs_rlcmac_ul_tbf *tbf, bitvec rc = write_alpha_gamma(dest, alpha, gamma); CHECK(rc); - /* No TIMING_ADVANCE_INDEX */ - SET_0(dest); + rc = write_ta_index(dest, ta_idx); + CHECK(rc); /* No TBF_STARTING_TIME */ SET_0(dest); @@ -514,7 +514,7 @@ int Encoding::write_immediate_assignment( if (as_ul_tbf(tbf) != NULL) { dest->cur_bit = wp; - rc = write_ia_rest_egprs_uplink_sba(as_ul_tbf(tbf), dest, usf, alpha, gamma); + rc = write_ia_rest_egprs_uplink_sba(as_ul_tbf(tbf), dest, usf, alpha, gamma, ta_idx); } else { dest->cur_bit = wp; rc = write_ia_rest_egprs_uplink_mba(dest, fn, alpha, gamma); @@ -527,7 +527,7 @@ int Encoding::write_immediate_assignment( if (as_ul_tbf(tbf) != NULL) { dest->cur_bit = wp; - rc = write_ia_rest_uplink_mba(as_ul_tbf(tbf), dest, usf, alpha, gamma); + rc = write_ia_rest_uplink_mba(as_ul_tbf(tbf), dest, usf, alpha, gamma, ta_idx); } else { dest->cur_bit = wp; rc = write_ia_rest_uplink_sba(dest, fn, alpha, gamma); diff --git a/tests/types/TypesTest.cpp b/tests/types/TypesTest.cpp index 822bd514..589f1562 100644 --- a/tests/types/TypesTest.cpp +++ b/tests/types/TypesTest.cpp @@ -497,7 +497,7 @@ void test_immediate_assign_ul0m() 0x23, /* TA */ 0x00, /* 0-length §10.5.2.21 Mobile Allocation */ /* ETSI TS 44.018 §10.5.2.16 IA Rest Octets */ - 0xc8, 0x02, 0x1b, 0xa0, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, }; + 0xc8, 0x02, 0x1b, 0xa2, 0x0b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, }; check_imm_ass(tbf, false, GSM_L1_BURST_TYPE_ACCESS_0, res, sizeof(res), "ia_rest_uplink(MBA)"); } @@ -537,7 +537,7 @@ void test_immediate_assign_ul1s() 0x23, /* TA */ 0x00, /* 0-length §10.5.2.21 Mobile Allocation */ /* ETSI TS 44.018 §10.5.2.16 IA Rest Octets */ - 0x46, 0xa0, 0x08, 0x00, 0x17, 0x40, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, }; + 0x46, 0xa0, 0x08, 0x00, 0x17, 0x44, 0x0b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, }; check_imm_ass(tbf, false, GSM_L1_BURST_TYPE_ACCESS_1, res, sizeof(res), "ia_rest_egprs_uplink(SBA)"); } diff --git a/tests/types/TypesTest.ok b/tests/types/TypesTest.ok index c6974d5a..a5c58b89 100644 --- a/tests/types/TypesTest.ok +++ b/tests/types/TypesTest.ok @@ -9,13 +9,13 @@ show_rbb: IIRRIIIR [11] DL Immediate Assignment : 06 3f 30 0d 23 6d 7f 03 18 23 00 d0 00 00 00 08 17 47 08 0b 5b 2b 2b [11] UL Immediate Assignment : - 06 3f 10 0d 23 6d 0d 03 18 23 00 c8 02 1b a0 2b 2b 2b 2b 2b 2b 2b 2b + 06 3f 10 0d 23 6d 0d 03 18 23 00 c8 02 1b a2 0b 2b 2b 2b 2b 2b 2b 2b [11] UL Immediate Assignment : 06 3f 10 0d 23 6d 0d 03 18 23 00 c5 d0 80 b5 ab 2b 2b 2b 2b 2b 2b 2b [11] UL Immediate Assignment : 06 3f 10 0d 23 6d 7f 03 18 23 00 46 97 40 0b 58 2b 2b 2b 2b 2b 2b 2b [11] UL Immediate Assignment : - 06 3f 10 0d 23 6d 7f 03 18 23 00 46 a0 08 00 17 40 2b 2b 2b 2b 2b 2b + 06 3f 10 0d 23 6d 7f 03 18 23 00 46 a0 08 00 17 44 0b 2b 2b 2b 2b 2b assignment reject: 06 3a 10 7f 06 36 14 7f 06 36 14 7f 06 36 14 7f 06 36 14 c0 2b 2b assignment reject: 06 3a 10 70 06 36 14 70 06 36 14 70 06 36 14 70 06 36 14 0b 2b 2b Testing LBS utility...