refactoring TA command structure in UE

master
yagoda 5 years ago committed by Andre Puschmann
parent 2db90c5dd3
commit fc1c506d1f

@ -77,6 +77,7 @@ private:
void process_mch_pdu(srslte::mch_pdu* pdu); void process_mch_pdu(srslte::mch_pdu* pdu);
bool process_ce(srslte::sch_subh* subheader); bool process_ce(srslte::sch_subh* subheader);
void parse_ta_cmd(srslte::sch_subh *subh);
bool is_uecrid_successful; bool is_uecrid_successful;

@ -100,17 +100,19 @@ void demux::push_pdu_temp_crnti(uint8_t* buff, uint32_t nof_bytes)
// Look for Contention Resolution UE ID and TA commands // Look for Contention Resolution UE ID and TA commands
is_uecrid_successful = false; is_uecrid_successful = false;
while (pending_mac_msg.next()) { while (pending_mac_msg.next()) {
if (pending_mac_msg.get()->ce_type() == srslte::sch_subh::CON_RES_ID) { switch (pending_mac_msg.get()->ce_type()) {
Debug("Found Contention Resolution ID CE\n"); case srslte::sch_subh::CON_RES_ID:
is_uecrid_successful = mac->contention_resolution_id_rcv(pending_mac_msg.get()->get_con_res_id()); if (!is_uecrid_successful) {
} else if (pending_mac_msg.get()->ce_type() == srslte::sch_subh::TA_CMD) { Debug("Found Contention Resolution ID CE\n");
phy_h->set_timeadv(pending_mac_msg.get()->get_ta_cmd()); is_uecrid_successful = mac->contention_resolution_id_rcv(
Info("Received TA=%d (%d/%d) \n", pending_mac_msg.get()->get_ta_cmd(), pending_mac_msg.get()->get_con_res_id());
time_alignment_timer->value(), time_alignment_timer->duration());
// Start or restart timeAlignmentTimer only if set
if (time_alignment_timer->is_set()) {
time_alignment_timer->run();
} }
break;
case srslte::sch_subh::TA_CMD:
parse_ta_cmd(pending_mac_msg.get());
break;
default:
break;
} }
} }
pending_mac_msg.reset(); pending_mac_msg.reset();
@ -285,15 +287,7 @@ bool demux::process_ce(srslte::sch_subh* subh)
// Do nothing // Do nothing
break; break;
case srslte::sch_subh::TA_CMD: case srslte::sch_subh::TA_CMD:
phy_h->set_timeadv(subh->get_ta_cmd()); parse_ta_cmd(subh);
Info("Received TA=%d (%d/%d) \n",
subh->get_ta_cmd(),
time_alignment_timer->value(),
time_alignment_timer->duration());
// Start or restart timeAlignmentTimer only if set
if (time_alignment_timer->is_set()) {
time_alignment_timer->run();
}
break; break;
case srslte::sch_subh::SCELL_ACTIVATION: case srslte::sch_subh::SCELL_ACTIVATION:
cc_idx = (uint32_t)subh->get_activation_deactivation_cmd(); cc_idx = (uint32_t)subh->get_activation_deactivation_cmd();
@ -309,4 +303,14 @@ bool demux::process_ce(srslte::sch_subh* subh)
return true; return true;
} }
void demux::parse_ta_cmd(srslte::sch_subh *subh) {
phy_h->set_timeadv(subh->get_ta_cmd());
Info("Received TA=%d (%d/%d) \n", subh->get_ta_cmd(),
time_alignment_timer->value(), time_alignment_timer->duration());
// Start or restart timeAlignmentTimer only if set
if (time_alignment_timer->is_set()) {
time_alignment_timer->run();
}
}
} // namespace srsue } // namespace srsue

Loading…
Cancel
Save