diff --git a/lib/include/srslte/upper/pdcp_entity_nr.h b/lib/include/srslte/upper/pdcp_entity_nr.h index 7e95156d9..c182270e2 100644 --- a/lib/include/srslte/upper/pdcp_entity_nr.h +++ b/lib/include/srslte/upper/pdcp_entity_nr.h @@ -64,8 +64,6 @@ private: srsue::rrc_interface_pdcp* rrc = nullptr; srsue::gw_interface_pdcp* gw = nullptr; - uint16_t sn_len_bytes = 0; - // State variables: 3GPP TS 38.323 v15.2.0, section 7.1 uint32_t tx_next = 0; // COUNT value of next SDU to be transmitted. uint32_t rx_next = 0; // COUNT value of next SDU expected to be received. diff --git a/lib/src/upper/pdcp_entity_nr.cc b/lib/src/upper/pdcp_entity_nr.cc index 4027792cb..30ed08600 100644 --- a/lib/src/upper/pdcp_entity_nr.cc +++ b/lib/src/upper/pdcp_entity_nr.cc @@ -103,7 +103,7 @@ void pdcp_entity_nr::write_pdu(unique_byte_buffer_t pdu) (do_encryption) ? "true" : "false"); // Sanity check - if (pdu->N_bytes <= sn_len_bytes) { + if (pdu->N_bytes <= cfg.hdr_len_bytes) { return; } @@ -173,12 +173,12 @@ uint32_t pdcp_entity_nr::get_rcvd_sn(const unique_byte_buffer_t& pdu) void pdcp_entity_nr::write_data_header(const srslte::unique_byte_buffer_t& sdu, uint32_t count) { // Check enough space for header - if (sn_len_bytes > sdu->get_headroom()) { + if (cfg.hdr_len_bytes > sdu->get_headroom()) { log->error("Not enough space to add header\n"); return; } - sdu->msg -= sn_len_bytes; - sdu->N_bytes += sn_len_bytes; + sdu->msg -= cfg.hdr_len_bytes; + sdu->N_bytes += cfg.hdr_len_bytes; switch (cfg.sn_len) { case PDCP_SN_LEN_12: