encoding: Encode TA in UL ACK/NACK if available

Change-Id: I3b060ee16aeac5f5d9b314b6bc46383f5e9c44c3
changes/03/24203/1
Pau Espin 2 years ago
parent 6bab522e90
commit c432e062ea
  1. 21
      src/encoding.cpp
  2. 8
      tests/tbf/TbfTest.cpp

@ -897,7 +897,15 @@ static void write_packet_uplink_ack_gprs(
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 @@ static void write_packet_uplink_ack_egprs(
}
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

@ -794,8 +794,8 @@ static gprs_rlcmac_ul_tbf *puan_urbb_len_issue(struct gprs_rlcmac_bts *bts,
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 @@ static gprs_rlcmac_ul_tbf *puan_urbb_len_issue(struct gprs_rlcmac_bts *bts,
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)) {

Loading…
Cancel
Save