lib,rlc_am_nr: add stop() method to TX entity

master
Pedro Alvarez 3 years ago
parent ec4914be19
commit 2f8fd7a483

@ -98,6 +98,7 @@ public:
void reestablish() final; void reestablish() final;
void stop() final; void stop() final;
void stop_no_lock();
int write_sdu(unique_byte_buffer_t sdu); int write_sdu(unique_byte_buffer_t sdu);
void empty_queue() final; void empty_queue() final;

@ -1167,7 +1167,33 @@ void rlc_am_nr_tx::empty_queue_no_lock()
unique_byte_buffer_t buf = tx_sdu_queue.read(); unique_byte_buffer_t buf = tx_sdu_queue.read();
} }
} }
void rlc_am_nr_tx::stop() {}
void rlc_am_nr_tx::stop()
{
std::lock_guard<std::mutex> lock(mutex);
stop_no_lock();
}
void rlc_am_nr_tx::stop_no_lock()
{
empty_queue_no_lock();
if (parent->timers != nullptr && poll_retransmit_timer.is_valid()) {
poll_retransmit_timer.stop();
}
st = {};
sdu_under_segmentation_sn = INVALID_RLC_SN;
// Drop all messages in TX window
tx_window->clear();
// Drop all messages in RETX queue
retx_queue->clear();
tx_enabled = false;
}
void rlc_am_nr_tx::timer_expired(uint32_t timeout_id) void rlc_am_nr_tx::timer_expired(uint32_t timeout_id)
{ {

Loading…
Cancel
Save