From e919c57a327416e2151e93e92c22f36d3fdeca66 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Mon, 10 Feb 2020 21:55:29 +0100 Subject: [PATCH] add handling of FollowOnFlag from tester --- srsue/test/ttcn3/hdr/ttcn3_helpers.h | 15 +++++++++++++++ srsue/test/ttcn3/hdr/ttcn3_interfaces.h | 7 ++++--- srsue/test/ttcn3/hdr/ttcn3_srb_interface.h | 7 ++++--- srsue/test/ttcn3/hdr/ttcn3_syssim.h | 13 ++++++++----- 4 files changed, 31 insertions(+), 11 deletions(-) diff --git a/srsue/test/ttcn3/hdr/ttcn3_helpers.h b/srsue/test/ttcn3/hdr/ttcn3_helpers.h index 2247f5019..22333c20f 100644 --- a/srsue/test/ttcn3/hdr/ttcn3_helpers.h +++ b/srsue/test/ttcn3/hdr/ttcn3_helpers.h @@ -382,6 +382,21 @@ public: } return timing; } + + static bool get_follow_on_flag(Document& document) + { + const Value& a = document["Common"]; + + // check cnf flag + assert(a.HasMember("ControlInfo")); + const Value& b = a["ControlInfo"]; + assert(b.HasMember("FollowOnFlag")); + + const Value& config_flag = b["FollowOnFlag"]; + assert(config_flag.IsBool()); + + return config_flag.GetBool(); + } }; #endif // SRSUE_TTCN3_HELPERS_H diff --git a/srsue/test/ttcn3/hdr/ttcn3_interfaces.h b/srsue/test/ttcn3/hdr/ttcn3_interfaces.h index 39d774f64..2a8bd98fe 100644 --- a/srsue/test/ttcn3/hdr/ttcn3_interfaces.h +++ b/srsue/test/ttcn3/hdr/ttcn3_interfaces.h @@ -71,9 +71,10 @@ public: class ss_srb_interface { public: - virtual void add_ccch_pdu(const timing_info_t timing, srslte::unique_byte_buffer_t pdu) = 0; - virtual void add_dcch_pdu(const timing_info_t timing, uint32_t lcid, srslte::unique_byte_buffer_t pdu) = 0; - virtual void reestablish_bearer(uint32_t lcid) = 0; + virtual void add_ccch_pdu(const timing_info_t timing, srslte::unique_byte_buffer_t pdu) = 0; + virtual void + add_dcch_pdu(const timing_info_t timing, uint32_t lcid, srslte::unique_byte_buffer_t pdu, bool follow_on_flag) = 0; + virtual void reestablish_bearer(uint32_t lcid) = 0; }; class syssim_interface_phy diff --git a/srsue/test/ttcn3/hdr/ttcn3_srb_interface.h b/srsue/test/ttcn3/hdr/ttcn3_srb_interface.h index 7134a5847..9fe6f36bf 100644 --- a/srsue/test/ttcn3/hdr/ttcn3_srb_interface.h +++ b/srsue/test/ttcn3/hdr/ttcn3_srb_interface.h @@ -101,7 +101,7 @@ private: } else if (rrcpdu.HasMember("Dcch")) { rx_buf_offset += 2; uint32_t lcid = document["Common"]["RoutingInfo"]["RadioBearerId"]["Srb"].GetInt(); - handle_dcch_pdu(document, lcid, &rx_buf->at(rx_buf_offset), n - rx_buf_offset); + handle_dcch_pdu(document, lcid, &rx_buf->at(rx_buf_offset), n - rx_buf_offset, ttcn3_helpers::get_follow_on_flag(document)); } else { log->error("Received unknown request.\n"); } @@ -128,7 +128,8 @@ private: } // Todo: move to SYSSIM - void handle_dcch_pdu(Document& document, const uint16_t lcid, const uint8_t* payload, const uint16_t len) + void + handle_dcch_pdu(Document& document, const uint16_t lcid, const uint8_t* payload, const uint16_t len, bool follow_on) { log->info_hex(payload, len, "Received DCCH RRC PDU (lcid=%d)\n", lcid); @@ -137,7 +138,7 @@ private: pdu->N_bytes = len; memcpy(pdu->msg, payload, pdu->N_bytes); - syssim->add_dcch_pdu(ttcn3_helpers::get_timing_info(document), lcid, std::move(pdu)); + syssim->add_dcch_pdu(ttcn3_helpers::get_timing_info(document), lcid, std::move(pdu), follow_on); } bool ccch_is_rrc_reestablishment(Document& document) diff --git a/srsue/test/ttcn3/hdr/ttcn3_syssim.h b/srsue/test/ttcn3/hdr/ttcn3_syssim.h index 8068420b6..0856b1cda 100644 --- a/srsue/test/ttcn3/hdr/ttcn3_syssim.h +++ b/srsue/test/ttcn3/hdr/ttcn3_syssim.h @@ -824,22 +824,23 @@ public: } } - void add_dcch_pdu(const timing_info_t timing, uint32_t lcid, unique_byte_buffer_t pdu) + void add_dcch_pdu(const timing_info_t timing, uint32_t lcid, unique_byte_buffer_t pdu, bool follow_on_flag) { if (timing.now) { - add_dcch_pdu_impl(lcid, std::move(pdu)); + add_dcch_pdu_impl(lcid, std::move(pdu), follow_on_flag); } else { log.debug("Scheduling DCCH PDU for TTI=%d\n", timing.tti); - auto task = [this](uint32_t lcid, srslte::unique_byte_buffer_t& pdu) { add_dcch_pdu_impl(lcid, std::move(pdu)); }; - tti_actions[timing.tti].push_back(std::bind(task, lcid, std::move(pdu))); + auto task = [this](uint32_t lcid, srslte::unique_byte_buffer_t& pdu, bool follow_on_flag) { add_dcch_pdu_impl(lcid, std::move(pdu), follow_on_flag); }; + tti_actions[timing.tti].push_back(std::bind(task, lcid, std::move(pdu), follow_on_flag)); } } - void add_dcch_pdu_impl(uint32_t lcid, unique_byte_buffer_t pdu) + void add_dcch_pdu_impl(uint32_t lcid, unique_byte_buffer_t pdu, bool follow_on_flag) { // push to PDCP and create DL grant for it log.info("Writing PDU (%d B) to LCID=%d\n", pdu->N_bytes, lcid); pdcp.write_sdu(lcid, std::move(pdu), true); + bearer_follow_on_map[lcid] = follow_on_flag; } void add_pch_pdu(unique_byte_buffer_t pdu) @@ -978,6 +979,7 @@ public: dl_grant.tb[0].ndi_present = true; dl_grant.tb[0].ndi = get_ndi_for_new_dl_tx(tti); + // Pass to UE ue->new_tb(dl_grant, (const uint8_t*)mac_pdu_ptr); } @@ -1146,6 +1148,7 @@ private: // Simulator objects srslte::rlc rlc; srslte::pdcp pdcp; + std::map bearer_follow_on_map; ///< Indicates if for a given LCID the follow_on_flag is set or not // security config bool as_security_enabled = false;