|
|
@ -59,11 +59,11 @@ public:
|
|
|
|
void write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer_t pdu) {}
|
|
|
|
void write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer_t pdu) {}
|
|
|
|
void notify_delivery(uint32_t lcid, const std::vector<uint32_t>& pdcp_sn_vec)
|
|
|
|
void notify_delivery(uint32_t lcid, const std::vector<uint32_t>& pdcp_sn_vec)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
assert(lcid == 1);
|
|
|
|
for (uint32_t pdcp_sn : pdcp_sn_vec) {
|
|
|
|
for (uint32_t pdcp_sn : pdcp_sn_vec) {
|
|
|
|
if (notified_counts.find(pdcp_sn) == notified_counts.end()) {
|
|
|
|
if (notified_counts.find(pdcp_sn) == notified_counts.end()) {
|
|
|
|
notified_counts[pdcp_sn] = 0;
|
|
|
|
notified_counts[pdcp_sn] = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
assert(lcid == 1);
|
|
|
|
|
|
|
|
notified_counts[pdcp_sn] += 1;
|
|
|
|
notified_counts[pdcp_sn] += 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -447,6 +447,7 @@ int retx_test()
|
|
|
|
rlc_status_pdu_t status_check = {};
|
|
|
|
rlc_status_pdu_t status_check = {};
|
|
|
|
rlc_am_read_status_pdu(status_buf.msg, status_buf.N_bytes, &status_check);
|
|
|
|
rlc_am_read_status_pdu(status_buf.msg, status_buf.N_bytes, &status_check);
|
|
|
|
TESTASSERT(status_check.N_nack == 1); // 1 packet was lost.
|
|
|
|
TESTASSERT(status_check.N_nack == 1); // 1 packet was lost.
|
|
|
|
|
|
|
|
TESTASSERT(status_check.nacks[0].nack_sn == 1); // SN 1 was lost.
|
|
|
|
TESTASSERT(status_check.ack_sn == 5); // Delivered up to SN 4.
|
|
|
|
TESTASSERT(status_check.ack_sn == 5); // Delivered up to SN 4.
|
|
|
|
|
|
|
|
|
|
|
|
// Write status PDU to RLC1
|
|
|
|
// Write status PDU to RLC1
|
|
|
@ -495,7 +496,7 @@ int retx_test()
|
|
|
|
// Assert status is correct
|
|
|
|
// Assert status is correct
|
|
|
|
status_check = {};
|
|
|
|
status_check = {};
|
|
|
|
rlc_am_read_status_pdu(status_buf.msg, status_buf.N_bytes, &status_check);
|
|
|
|
rlc_am_read_status_pdu(status_buf.msg, status_buf.N_bytes, &status_check);
|
|
|
|
TESTASSERT(status_check.N_nack == 0); // 1 packet was lost.
|
|
|
|
TESTASSERT(status_check.N_nack == 0); // No packet was lost.
|
|
|
|
TESTASSERT(status_check.ack_sn == 5); // Delivered up to SN 4.
|
|
|
|
TESTASSERT(status_check.ack_sn == 5); // Delivered up to SN 4.
|
|
|
|
|
|
|
|
|
|
|
|
// Write status PDU to RLC1
|
|
|
|
// Write status PDU to RLC1
|
|
|
@ -578,7 +579,7 @@ int segment_retx_test()
|
|
|
|
// Assert status is correct
|
|
|
|
// Assert status is correct
|
|
|
|
rlc_status_pdu_t status_check = {};
|
|
|
|
rlc_status_pdu_t status_check = {};
|
|
|
|
rlc_am_read_status_pdu(status_buf.msg, status_buf.N_bytes, &status_check);
|
|
|
|
rlc_am_read_status_pdu(status_buf.msg, status_buf.N_bytes, &status_check);
|
|
|
|
TESTASSERT(status_check.N_nack == 0); // 1 packet was lost.
|
|
|
|
TESTASSERT(status_check.N_nack == 0); // No packet was lost.
|
|
|
|
TESTASSERT(status_check.ack_sn == 1); // Delivered up to SN 0.
|
|
|
|
TESTASSERT(status_check.ack_sn == 1); // Delivered up to SN 0.
|
|
|
|
|
|
|
|
|
|
|
|
// Write status PDU to RLC1
|
|
|
|
// Write status PDU to RLC1
|
|
|
@ -612,7 +613,7 @@ int segment_retx_test()
|
|
|
|
// Assert status is correct
|
|
|
|
// Assert status is correct
|
|
|
|
status_check = {};
|
|
|
|
status_check = {};
|
|
|
|
rlc_am_read_status_pdu(status_buf.msg, status_buf.N_bytes, &status_check);
|
|
|
|
rlc_am_read_status_pdu(status_buf.msg, status_buf.N_bytes, &status_check);
|
|
|
|
TESTASSERT(status_check.N_nack == 0); // 1 packet was lost.
|
|
|
|
TESTASSERT(status_check.N_nack == 0); // No packet was lost.
|
|
|
|
TESTASSERT(status_check.ack_sn == 2); // Delivered up to SN 0.
|
|
|
|
TESTASSERT(status_check.ack_sn == 2); // Delivered up to SN 0.
|
|
|
|
|
|
|
|
|
|
|
|
// Make sure SDU was notified
|
|
|
|
// Make sure SDU was notified
|
|
|
@ -698,6 +699,7 @@ int resegment_test_1()
|
|
|
|
rlc_status_pdu_t status_check = {};
|
|
|
|
rlc_status_pdu_t status_check = {};
|
|
|
|
rlc_am_read_status_pdu(status_buf.msg, status_buf.N_bytes, &status_check);
|
|
|
|
rlc_am_read_status_pdu(status_buf.msg, status_buf.N_bytes, &status_check);
|
|
|
|
TESTASSERT(status_check.N_nack == 1); // 1 packet was lost.
|
|
|
|
TESTASSERT(status_check.N_nack == 1); // 1 packet was lost.
|
|
|
|
|
|
|
|
TESTASSERT(status_check.nacks[0].nack_sn == 1); // SN 1 was lost.
|
|
|
|
TESTASSERT(status_check.ack_sn == 5); // Delivered up to SN 5.
|
|
|
|
TESTASSERT(status_check.ack_sn == 5); // Delivered up to SN 5.
|
|
|
|
|
|
|
|
|
|
|
|
// Write status PDU to RLC1
|
|
|
|
// Write status PDU to RLC1
|
|
|
@ -741,6 +743,7 @@ int resegment_test_1()
|
|
|
|
status_check = {};
|
|
|
|
status_check = {};
|
|
|
|
rlc_am_read_status_pdu(status_buf.msg, status_buf.N_bytes, &status_check);
|
|
|
|
rlc_am_read_status_pdu(status_buf.msg, status_buf.N_bytes, &status_check);
|
|
|
|
TESTASSERT(status_check.N_nack == 1); // 1 packet was lost.
|
|
|
|
TESTASSERT(status_check.N_nack == 1); // 1 packet was lost.
|
|
|
|
|
|
|
|
TESTASSERT(status_check.nacks[0].nack_sn == 1); // SN 1 was lost.
|
|
|
|
TESTASSERT(status_check.ack_sn == 5); // Delivered up to SN 5.
|
|
|
|
TESTASSERT(status_check.ack_sn == 5); // Delivered up to SN 5.
|
|
|
|
|
|
|
|
|
|
|
|
// Read the remaining segment
|
|
|
|
// Read the remaining segment
|
|
|
@ -854,7 +857,7 @@ int resegment_test_2()
|
|
|
|
// Assert status is correct
|
|
|
|
// Assert status is correct
|
|
|
|
rlc_status_pdu_t status_check = {};
|
|
|
|
rlc_status_pdu_t status_check = {};
|
|
|
|
rlc_am_read_status_pdu(status_buf.msg, status_buf.N_bytes, &status_check);
|
|
|
|
rlc_am_read_status_pdu(status_buf.msg, status_buf.N_bytes, &status_check);
|
|
|
|
TESTASSERT(status_check.N_nack == 1); // all packets delivered.
|
|
|
|
TESTASSERT(status_check.N_nack == 1); // One packet was lost.
|
|
|
|
TESTASSERT(status_check.ack_sn == 5); // Delivered up to SN 5.
|
|
|
|
TESTASSERT(status_check.ack_sn == 5); // Delivered up to SN 5.
|
|
|
|
|
|
|
|
|
|
|
|
// Write status PDU to RLC1
|
|
|
|
// Write status PDU to RLC1
|
|
|
@ -987,7 +990,8 @@ int resegment_test_3()
|
|
|
|
// Assert status is correct
|
|
|
|
// Assert status is correct
|
|
|
|
rlc_status_pdu_t status_check = {};
|
|
|
|
rlc_status_pdu_t status_check = {};
|
|
|
|
rlc_am_read_status_pdu(status_buf.msg, status_buf.N_bytes, &status_check);
|
|
|
|
rlc_am_read_status_pdu(status_buf.msg, status_buf.N_bytes, &status_check);
|
|
|
|
TESTASSERT(status_check.N_nack == 1); // all packets delivered.
|
|
|
|
TESTASSERT(status_check.N_nack == 1); // One packet was lost.
|
|
|
|
|
|
|
|
TESTASSERT(status_check.nacks[0].nack_sn == 2); // SN 2 was lost.
|
|
|
|
TESTASSERT(status_check.ack_sn == 5); // Delivered up to SN 5.
|
|
|
|
TESTASSERT(status_check.ack_sn == 5); // Delivered up to SN 5.
|
|
|
|
|
|
|
|
|
|
|
|
// Write status PDU to RLC1
|
|
|
|
// Write status PDU to RLC1
|
|
|
@ -1118,7 +1122,8 @@ int resegment_test_4()
|
|
|
|
// Assert status is correct
|
|
|
|
// Assert status is correct
|
|
|
|
rlc_status_pdu_t status_check = {};
|
|
|
|
rlc_status_pdu_t status_check = {};
|
|
|
|
rlc_am_read_status_pdu(status_buf.msg, status_buf.N_bytes, &status_check);
|
|
|
|
rlc_am_read_status_pdu(status_buf.msg, status_buf.N_bytes, &status_check);
|
|
|
|
TESTASSERT(status_check.N_nack == 1); // all packets delivered.
|
|
|
|
TESTASSERT(status_check.N_nack == 1); // one packet lost.
|
|
|
|
|
|
|
|
TESTASSERT(status_check.nacks[0].nack_sn == 2); // SN 2 was lost.
|
|
|
|
TESTASSERT(status_check.ack_sn == 5); // Delivered up to SN 5.
|
|
|
|
TESTASSERT(status_check.ack_sn == 5); // Delivered up to SN 5.
|
|
|
|
|
|
|
|
|
|
|
|
// Write status PDU to RLC1
|
|
|
|
// Write status PDU to RLC1
|
|
|
@ -1250,7 +1255,8 @@ int resegment_test_5()
|
|
|
|
// Assert status is correct
|
|
|
|
// Assert status is correct
|
|
|
|
rlc_status_pdu_t status_check = {};
|
|
|
|
rlc_status_pdu_t status_check = {};
|
|
|
|
rlc_am_read_status_pdu(status_buf.msg, status_buf.N_bytes, &status_check);
|
|
|
|
rlc_am_read_status_pdu(status_buf.msg, status_buf.N_bytes, &status_check);
|
|
|
|
TESTASSERT(status_check.N_nack == 1); // all packets delivered.
|
|
|
|
TESTASSERT(status_check.N_nack == 1); // one packet was lost.
|
|
|
|
|
|
|
|
TESTASSERT(status_check.nacks[0].nack_sn == 2); // SN 2 was lost.
|
|
|
|
TESTASSERT(status_check.ack_sn == 5); // Delivered up to SN 5.
|
|
|
|
TESTASSERT(status_check.ack_sn == 5); // Delivered up to SN 5.
|
|
|
|
|
|
|
|
|
|
|
|
// Write status PDU to RLC1
|
|
|
|
// Write status PDU to RLC1
|
|
|
@ -1389,7 +1395,8 @@ int resegment_test_6()
|
|
|
|
// Assert status is correct
|
|
|
|
// Assert status is correct
|
|
|
|
rlc_status_pdu_t status_check = {};
|
|
|
|
rlc_status_pdu_t status_check = {};
|
|
|
|
rlc_am_read_status_pdu(status_buf.msg, status_buf.N_bytes, &status_check);
|
|
|
|
rlc_am_read_status_pdu(status_buf.msg, status_buf.N_bytes, &status_check);
|
|
|
|
TESTASSERT(status_check.N_nack == 1);
|
|
|
|
TESTASSERT(status_check.N_nack == 1); // One packet was lost.
|
|
|
|
|
|
|
|
TESTASSERT(status_check.nacks[0].nack_sn == 3); // SN 3 was lost.
|
|
|
|
TESTASSERT(status_check.ack_sn == 5);
|
|
|
|
TESTASSERT(status_check.ack_sn == 5);
|
|
|
|
|
|
|
|
|
|
|
|
// Write status PDU to RLC1
|
|
|
|
// Write status PDU to RLC1
|
|
|
@ -1576,7 +1583,8 @@ int resegment_test_7()
|
|
|
|
// Assert status is correct
|
|
|
|
// Assert status is correct
|
|
|
|
rlc_status_pdu_t status_check = {};
|
|
|
|
rlc_status_pdu_t status_check = {};
|
|
|
|
rlc_am_read_status_pdu(status_buf.msg, status_buf.N_bytes, &status_check);
|
|
|
|
rlc_am_read_status_pdu(status_buf.msg, status_buf.N_bytes, &status_check);
|
|
|
|
TESTASSERT(status_check.N_nack == 1); // all packets delivered.
|
|
|
|
TESTASSERT(status_check.N_nack == 1); // one packet dropped.
|
|
|
|
|
|
|
|
TESTASSERT(status_check.nacks[0].nack_sn == 2); // SN 2 dropped.
|
|
|
|
TESTASSERT(status_check.ack_sn == 5); // Delivered up to SN 5.
|
|
|
|
TESTASSERT(status_check.ack_sn == 5); // Delivered up to SN 5.
|
|
|
|
|
|
|
|
|
|
|
|
// Write status PDU to RLC1
|
|
|
|
// Write status PDU to RLC1
|
|
|
|