Starting to add getters and setters of the state in PDCP lte entity.

master
Pedro Alvarez 5 years ago
parent 0e415260e9
commit 4093e75237

@ -39,6 +39,13 @@ namespace srslte {
#define PDCP_CONTROL_MAC_I 0x00000000
struct pdcp_lte_state_t {
uint32_t tx_count;
uint32_t rx_hfn;
uint32_t next_pdcp_rx_sn;
uint32_t last_submitted_pdcp_rx_sn;
};
/****************************************************************************
* LTE PDCP Entity
* Class for LTE PDCP entities
@ -57,8 +64,10 @@ public:
void reestablish();
// GW/RRC interface
void write_sdu(unique_byte_buffer_t sdu, bool blocking);
void get_bearer_status(uint16_t* dlsn, uint16_t* dlhfn, uint16_t* ulsn, uint16_t* ulhfn);
void write_sdu(unique_byte_buffer_t sdu, bool blocking);
void get_bearer_status(uint16_t* dlsn, uint16_t* dlhfn, uint16_t* ulsn, uint16_t* ulhfn);
pdcp_lte_state_t get_state();
void set_state(const pdcp_lte_state_t& state);
// RLC interface
void write_pdu(unique_byte_buffer_t pdu);

@ -29,12 +29,8 @@ pdcp_entity_lte::pdcp_entity_lte(srsue::rlc_interface_pdcp* rlc_,
srsue::gw_interface_pdcp* gw_,
srslte::task_handler_interface* task_executor_,
srslte::log_ref log_) :
pdcp_entity_base(task_executor_, log_),
rlc(rlc_),
rrc(rrc_),
gw(gw_)
{
}
pdcp_entity_base(task_executor_, log_), rlc(rlc_), rrc(rrc_), gw(gw_)
{}
pdcp_entity_lte::~pdcp_entity_lte()
{
@ -79,15 +75,15 @@ void pdcp_entity_lte::reestablish()
log->info("Re-establish %s with bearer ID: %d\n", rrc->get_rb_name(lcid).c_str(), cfg.bearer_id);
// For SRBs
if (is_srb()) {
tx_count = 0;
rx_hfn = 0;
next_pdcp_rx_sn = 0;
tx_count = 0;
rx_hfn = 0;
next_pdcp_rx_sn = 0;
} else {
// Only reset counter in RLC-UM
if (rlc->rb_is_um(lcid)) {
tx_count = 0;
rx_hfn = 0;
next_pdcp_rx_sn = 0;
tx_count = 0;
rx_hfn = 0;
next_pdcp_rx_sn = 0;
}
}
}
@ -370,4 +366,20 @@ bool pdcp_entity_lte::check_valid_config()
return true;
}
/****************************************************************************
* Internal state getters/setters
***************************************************************************/
pdcp_lte_state_t pdcp_entity_lte::get_state()
{
return pdcp_lte_state_t{tx_count, rx_hfn, next_pdcp_rx_sn, last_submitted_pdcp_rx_sn};
}
void pdcp_entity_lte::set_state(const pdcp_lte_state_t& state)
{
tx_count = state.tx_count;
rx_hfn = state.rx_hfn;
next_pdcp_rx_sn = state.next_pdcp_rx_sn;
last_submitted_pdcp_rx_sn = state.last_submitted_pdcp_rx_sn;
}
} // namespace srslte

Loading…
Cancel
Save