add handling of FollowOnFlag from tester

master
Andre Puschmann 5 years ago
parent 51864bc03c
commit e919c57a32

@ -382,6 +382,21 @@ public:
} }
return timing; 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 #endif // SRSUE_TTCN3_HELPERS_H

@ -71,9 +71,10 @@ public:
class ss_srb_interface class ss_srb_interface
{ {
public: public:
virtual void add_ccch_pdu(const timing_info_t timing, srslte::unique_byte_buffer_t pdu) = 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) = 0; virtual void
virtual void reestablish_bearer(uint32_t lcid) = 0; 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 class syssim_interface_phy

@ -101,7 +101,7 @@ private:
} else if (rrcpdu.HasMember("Dcch")) { } else if (rrcpdu.HasMember("Dcch")) {
rx_buf_offset += 2; rx_buf_offset += 2;
uint32_t lcid = document["Common"]["RoutingInfo"]["RadioBearerId"]["Srb"].GetInt(); 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 { } else {
log->error("Received unknown request.\n"); log->error("Received unknown request.\n");
} }
@ -128,7 +128,8 @@ private:
} }
// Todo: move to SYSSIM // 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); log->info_hex(payload, len, "Received DCCH RRC PDU (lcid=%d)\n", lcid);
@ -137,7 +138,7 @@ private:
pdu->N_bytes = len; pdu->N_bytes = len;
memcpy(pdu->msg, payload, pdu->N_bytes); 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) bool ccch_is_rrc_reestablishment(Document& document)

@ -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) { if (timing.now) {
add_dcch_pdu_impl(lcid, std::move(pdu)); add_dcch_pdu_impl(lcid, std::move(pdu), follow_on_flag);
} else { } else {
log.debug("Scheduling DCCH PDU for TTI=%d\n", timing.tti); 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)); }; 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))); 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 // push to PDCP and create DL grant for it
log.info("Writing PDU (%d B) to LCID=%d\n", pdu->N_bytes, lcid); log.info("Writing PDU (%d B) to LCID=%d\n", pdu->N_bytes, lcid);
pdcp.write_sdu(lcid, std::move(pdu), true); 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) 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_present = true;
dl_grant.tb[0].ndi = get_ndi_for_new_dl_tx(tti); 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); ue->new_tb(dl_grant, (const uint8_t*)mac_pdu_ptr);
} }
@ -1146,6 +1148,7 @@ private:
// Simulator objects // Simulator objects
srslte::rlc rlc; srslte::rlc rlc;
srslte::pdcp pdcp; srslte::pdcp pdcp;
std::map<uint32_t, bool> bearer_follow_on_map; ///< Indicates if for a given LCID the follow_on_flag is set or not
// security config // security config
bool as_security_enabled = false; bool as_security_enabled = false;

Loading…
Cancel
Save