From 39f2011699484c52b4e514f3af1a5755e6072d46 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Mon, 24 Feb 2020 10:42:08 +0100 Subject: [PATCH] fix issue in SS where Msg4 wouldn't be sent because ConnectionSetup is provided too late --- srsue/src/stack/mac/proc_ra.cc | 2 +- srsue/test/ttcn3/hdr/ttcn3_syssim.h | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/srsue/src/stack/mac/proc_ra.cc b/srsue/src/stack/mac/proc_ra.cc index 8f7288aad..95716d9bf 100644 --- a/srsue/src/stack/mac/proc_ra.cc +++ b/srsue/src/stack/mac/proc_ra.cc @@ -41,7 +41,7 @@ const char* state_str[] = {"RA: INIT: ", "RA: INIT: ", "RA: PDCCH: ", "RA: Rx: ", - "RA: Backoff:", + "RA: Backoff: ", "RA: ConRes: ", "RA: WaitComplt: ", "RA: Complt: "}; diff --git a/srsue/test/ttcn3/hdr/ttcn3_syssim.h b/srsue/test/ttcn3/hdr/ttcn3_syssim.h index 481086ac3..1a04ab64f 100644 --- a/srsue/test/ttcn3/hdr/ttcn3_syssim.h +++ b/srsue/test/ttcn3/hdr/ttcn3_syssim.h @@ -269,7 +269,8 @@ public: // look for DL data to be send in each bearer and provide grant accordingly for (int lcid = 0; lcid < SRSLTE_N_RADIO_BEARERS; lcid++) { uint32_t buf_state = rlc.get_buffer_state(lcid); - if (buf_state > 0) { + // Schedule DL transmission if there is data in RLC buffer or we need to send Msg4 + if (buf_state > 0 || (msg3_tti != -1 && conres_id != 0)) { log.debug("LCID=%d, buffer_state=%d\n", lcid, buf_state); const uint32_t mac_header_size = 10; // Add MAC header (10 B for all subheaders, etc) if (tmp_rlc_buffer.get_tailroom() > (buf_state + mac_header_size)) { @@ -278,19 +279,18 @@ public: mac_msg_dl.init_tx(&tx_payload_buffer, pdu_size + mac_header_size, false); // check if this is Msg4 that needs to contain the contention resolution ID CE - if (msg3_tti != -1) { - if (lcid == 0) { - if (mac_msg_dl.new_subh()) { - if (mac_msg_dl.get()->set_con_res_id(conres_id)) { - log.info("CE: Added Contention Resolution ID=0x%" PRIx64 "\n", conres_id); - } else { - log.error("CE: Setting Contention Resolution ID CE\n"); - } + if (msg3_tti != -1 && lcid == 0 && conres_id != 0) { + if (mac_msg_dl.new_subh()) { + if (mac_msg_dl.get()->set_con_res_id(conres_id)) { + log.info("CE: Added Contention Resolution ID=0x%" PRIx64 "\n", conres_id); } else { - log.error("CE: Setting Contention Resolution ID CE. No space for a subheader\n"); + log.error("CE: Setting Contention Resolution ID CE\n"); } - msg3_tti = -1; + conres_id = 0; // reset CR so it's not sent twice + } else { + log.error("CE: Setting Contention Resolution ID CE. No space for a subheader\n"); } + msg3_tti = -1; } // Add payload