Added tests for PDCP NR Rx with SN Len = 18. In-sequence reception seems to work.

master
Pedro Alvarez 6 years ago committed by Andre Puschmann
parent d4aeb12db8
commit 38bbc55631

@ -187,10 +187,11 @@ void pdcp_entity_nr::read_data_header(const unique_byte_buffer_t& pdu, uint32_t
switch (cfg.sn_len) {
case PDCP_SN_LEN_12:
srslte::uint8_to_uint16(pdu->msg, &rcvd_sn_16);
(*rcvd_sn) = 0x0FFF & rcvd_sn_16;
(*rcvd_sn) = SN(rcvd_sn_16);
break;
case PDCP_SN_LEN_18:
// srslte::uint8_to_uint24((uint16_t*)sdu->msg, rcvd_sn);
srslte::uint8_to_uint24(pdu->msg, rcvd_sn);
(*rcvd_sn) = SN(*rcvd_sn);
break;
default:
log->error("Cannot extract RCVD_SN, invalid SN length configured: %d\n", cfg.sn_len);

@ -222,7 +222,7 @@ int test_tx_all(srslte::byte_buffer_pool* pool, srslte::log* log)
srslte::unique_byte_buffer_t pdu_exp_sn0_len18 = allocate_unique_buffer(*pool);
memcpy(pdu_exp_sn0_len18->msg, pdu4, PDU4_LEN);
pdu_exp_sn0_len18->N_bytes = PDU4_LEN;
//TESTASSERT(test_tx(1, srslte::PDCP_SN_LEN_18, std::move(pdu_exp_sn0_len18), pool, log) == 0);
TESTASSERT(test_tx(1, srslte::PDCP_SN_LEN_18, std::move(pdu_exp_sn0_len18), pool, log) == 0);
/*
* TX Test 5: PDCP Entity with SN LEN = 18
@ -254,14 +254,14 @@ int test_tx_all(srslte::byte_buffer_pool* pool, srslte::log* log)
* RX Test: PDCP Entity with SN LEN = 12 and 18. Tested 4097 packets received without losses.
* PDCP entity configured with EIA2 and EEA2
*/
int test_rx_in_sequence(uint32_t n_packets, srslte::byte_buffer_pool* pool, srslte::log* log)
int test_rx_in_sequence(uint32_t n_packets, uint8_t pdcp_sn_len, srslte::byte_buffer_pool* pool, srslte::log* log)
{
srslte::pdcp_entity_nr pdcp_tx;
srslte::pdcp_entity_nr pdcp_rx;
srslte::srslte_pdcp_config_t cfg_tx = {
1, srslte::PDCP_RB_IS_DRB, SECURITY_DIRECTION_UPLINK, SECURITY_DIRECTION_DOWNLINK, srslte::PDCP_SN_LEN_12};
1, srslte::PDCP_RB_IS_DRB, SECURITY_DIRECTION_UPLINK, SECURITY_DIRECTION_DOWNLINK, pdcp_sn_len};
srslte::srslte_pdcp_config_t cfg_rx = {
1, srslte::PDCP_RB_IS_DRB, SECURITY_DIRECTION_DOWNLINK, SECURITY_DIRECTION_UPLINK, srslte::PDCP_SN_LEN_12};
1, srslte::PDCP_RB_IS_DRB, SECURITY_DIRECTION_DOWNLINK, SECURITY_DIRECTION_UPLINK, pdcp_sn_len};
rlc_dummy rlc_tx(log);
rrc_dummy rrc_tx(log);
@ -319,7 +319,8 @@ int run_all_tests(srslte::byte_buffer_pool* pool)
log.set_hex_limit(128);
TESTASSERT(test_tx_all(pool, &log) == 0);
TESTASSERT(test_rx_in_sequence(4097, pool, &log) == 0);
TESTASSERT(test_rx_in_sequence(4097, srslte::PDCP_SN_LEN_12, pool, &log) == 0);
TESTASSERT(test_rx_in_sequence(262145, srslte::PDCP_SN_LEN_18, pool, &log) == 0);
return 0;
}

Loading…
Cancel
Save