From 8e8a7a415453607361f0afc93bc0644594c7214a Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Thu, 4 Jul 2019 16:02:47 +0100 Subject: [PATCH] Add more logic to PDCP NR tx logic. --- lib/include/srslte/upper/pdcp_entity_nr.h | 4 ++-- lib/src/upper/pdcp_entity_nr.cc | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/include/srslte/upper/pdcp_entity_nr.h b/lib/include/srslte/upper/pdcp_entity_nr.h index 76c7d8736..cae28f7fa 100644 --- a/lib/include/srslte/upper/pdcp_entity_nr.h +++ b/lib/include/srslte/upper/pdcp_entity_nr.h @@ -33,8 +33,8 @@ namespace srslte { /**************************************************************************** - * PDCP Entity interface - * Common interface for all PDCP entities + * NR PDCP Entity + * PDCP entity for 5G NR ***************************************************************************/ class pdcp_entity_nr : public pdcp_entity_base { diff --git a/lib/src/upper/pdcp_entity_nr.cc b/lib/src/upper/pdcp_entity_nr.cc index 8035b435f..39362c1af 100644 --- a/lib/src/upper/pdcp_entity_nr.cc +++ b/lib/src/upper/pdcp_entity_nr.cc @@ -74,13 +74,17 @@ void pdcp_entity_nr::write_sdu(unique_byte_buffer_t sdu, bool blocking) (do_integrity) ? "true" : "false", (do_encryption) ? "true" : "false"); // Start discard timer TODO + // Perform header compression TODO - // - uint32_t count = tx_next; - - //integrity_generate(sdu); + // Integrity protection and ciphering + integrity_generate(sdu->msg, sdu->N_bytes - 4, tx_next, &sdu->msg[sdu->N_bytes - 4]); + ciphering_generate(sdu->msg, sdu->N_bytes - 4, tx_next, &sdu->msg[sdu->N_bytes - 4]); + // Write PDCP header info + write_header(pdu, tx_next); + // Write to lower layers + rlc->write_sdu(lcid, std::move(sdu), blocking); } // RLC interface