diff --git a/srsue/hdr/mac/mux.h b/srsue/hdr/mac/mux.h index ebc61b5c6..889dd68f3 100644 --- a/srsue/hdr/mac/mux.h +++ b/srsue/hdr/mac/mux.h @@ -67,6 +67,9 @@ public: void msg3_flush(); bool msg3_is_transmitted(); + + void msg3_prepare(); + bool msg3_is_pending(); void append_crnti_ce_next_tx(uint16_t crnti); @@ -105,6 +108,7 @@ private: /* PDU Buffer */ srslte::sch_pdu pdu_msg; bool msg3_has_been_transmitted; + bool msg3_pending; }; } // namespace srsue diff --git a/srsue/hdr/mac/ul_harq.h b/srsue/hdr/mac/ul_harq.h index 644167746..21b84aa60 100644 --- a/srsue/hdr/mac/ul_harq.h +++ b/srsue/hdr/mac/ul_harq.h @@ -238,7 +238,7 @@ private: reset(); // Uplink grant in a RAR and there is a PDU in the Msg3 buffer - if (grant->is_from_rar && !harq_entity->mux_unit->msg3_is_transmitted()) { + if (grant->is_from_rar && harq_entity->mux_unit->msg3_is_pending()) { Debug("Getting Msg3 buffer payload, grant size=%d bytes\n", grant->n_bytes[0]); pdu_ptr = harq_entity->mux_unit->msg3_get(payload_buffer, grant->n_bytes[0]); if (pdu_ptr) { @@ -246,6 +246,7 @@ private: } else { Warning("UL RAR grant available but no Msg3 on buffer\n"); } + printf("Transmitted Msg3\n"); // Normal UL grant } else { diff --git a/srsue/src/mac/mux.cc b/srsue/src/mac/mux.cc index ba2b45209..2f8ade2af 100644 --- a/srsue/src/mac/mux.cc +++ b/srsue/src/mac/mux.cc @@ -65,6 +65,7 @@ void mux::reset() for (uint32_t i=0;imsg3_prepare(); rntis->temp_rnti = rar_pdu_msg.get()->get_temp_crnti(); phy_h->pdcch_dl_search(SRSLTE_RNTI_TEMP, rar_pdu_msg.get()->get_temp_crnti());