|
|
|
@ -303,6 +303,57 @@ int rrc_write_pdu_bcch_dlsch_test()
|
|
|
|
|
return SRSRAN_SUCCESS;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int rrc_write_pdu_test()
|
|
|
|
|
{
|
|
|
|
|
srslog::basic_logger& logger = srslog::fetch_basic_logger("RRC-NR");
|
|
|
|
|
logger.set_level(srslog::basic_levels::debug);
|
|
|
|
|
logger.set_hex_dump_max_size(-1);
|
|
|
|
|
srsran::task_scheduler task_sched{512, 100};
|
|
|
|
|
srsran::task_sched_handle task_sched_handle(&task_sched);
|
|
|
|
|
rrc_nr rrc_nr(task_sched_handle);
|
|
|
|
|
|
|
|
|
|
dummy_phy dummy_phy;
|
|
|
|
|
dummy_mac dummy_mac;
|
|
|
|
|
dummy_rlc dummy_rlc;
|
|
|
|
|
dummy_pdcp dummy_pdcp;
|
|
|
|
|
dummy_gw dummy_gw;
|
|
|
|
|
dummy_eutra dummy_eutra;
|
|
|
|
|
dummy_sim dummy_sim;
|
|
|
|
|
dummy_stack dummy_stack;
|
|
|
|
|
rrc_nr_args_t rrc_nr_args;
|
|
|
|
|
TESTASSERT(rrc_nr.init(&dummy_phy,
|
|
|
|
|
&dummy_mac,
|
|
|
|
|
&dummy_rlc,
|
|
|
|
|
&dummy_pdcp,
|
|
|
|
|
&dummy_gw,
|
|
|
|
|
&dummy_eutra,
|
|
|
|
|
&dummy_sim,
|
|
|
|
|
task_sched.get_timer_handler(),
|
|
|
|
|
&dummy_stack,
|
|
|
|
|
rrc_nr_args) == SRSRAN_SUCCESS);
|
|
|
|
|
|
|
|
|
|
uint8_t msg[] = {0x20, 0x40, 0x04, 0x05, 0x9a, 0xe0, 0x05, 0x80, 0x08, 0x8b, 0xd7, 0x63, 0x80, 0x83, 0x0f, 0x00, 0x03,
|
|
|
|
|
0xa0, 0x10, 0x45, 0x41, 0xc2, 0x0a, 0x20, 0x92, 0x40, 0x0c, 0xa8, 0x00, 0x17, 0xf8, 0x00, 0x00, 0x00,
|
|
|
|
|
0x00, 0x08, 0x37, 0x08, 0x82, 0x00, 0x04, 0x91, 0x12, 0x50, 0x00, 0x04, 0x82, 0x00, 0x00, 0x20, 0x69,
|
|
|
|
|
0x84, 0x0c, 0x55, 0x92, 0x10, 0x70, 0x00, 0x41, 0x03, 0x08, 0x14, 0x30, 0x72, 0x71, 0x02, 0x45, 0x0b,
|
|
|
|
|
0x18, 0x34, 0x70, 0xf2, 0x38, 0x01, 0x98, 0x00, 0x85, 0x00, 0xc0, 0x8c, 0xc0, 0x05, 0x28, 0x06, 0x08,
|
|
|
|
|
0x66, 0x00, 0x31, 0x40, 0x30, 0x63, 0x30, 0x01, 0x0a, 0x03, 0x84, 0x19, 0x80, 0x0a, 0x50, 0x1c, 0x28,
|
|
|
|
|
0xcc, 0x00, 0x62, 0x80, 0xe1, 0x86, 0x60, 0x02, 0x14, 0x0b, 0x0e, 0x33, 0x00, 0x14, 0xa0, 0x58, 0x80,
|
|
|
|
|
0x08, 0xc9, 0x04, 0x31, 0x20, 0x11, 0x92, 0x09, 0x62, 0x80, 0x23, 0x24, 0x14, 0xc5, 0x80, 0x46, 0x48,
|
|
|
|
|
0x2d, 0x8c, 0x00, 0x8c, 0x90, 0x63, 0x1a, 0x01, 0x19, 0x20, 0xd6, 0x38, 0x02, 0x32, 0x41, 0xcc, 0x78,
|
|
|
|
|
0xc8, 0x02, 0x82, 0x19, 0x01, 0x98, 0x00, 0xc5, 0x02, 0xc8, 0x8c, 0x80, 0x28, 0x25, 0x02, 0x42, 0x18,
|
|
|
|
|
0x14, 0x40, 0x20, 0x91, 0x00, 0x0a, 0x41, 0x7f, 0xf4, 0xa5, 0x26, 0x31, 0x8d, 0x80};
|
|
|
|
|
|
|
|
|
|
srsran::unique_byte_buffer_t pdu = srsran::make_byte_buffer();
|
|
|
|
|
memcpy(pdu->msg, msg, sizeof(msg));
|
|
|
|
|
pdu->N_bytes = sizeof(msg);
|
|
|
|
|
|
|
|
|
|
rrc_nr.write_pdu(0, std::move(pdu));
|
|
|
|
|
task_sched.run_pending_tasks();
|
|
|
|
|
|
|
|
|
|
return SRSRAN_SUCCESS;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int main(int argc, char** argv)
|
|
|
|
|
{
|
|
|
|
|
srslog::init();
|
|
|
|
@ -311,6 +362,7 @@ int main(int argc, char** argv)
|
|
|
|
|
TESTASSERT(rrc_nr_reconfig_test() == SRSRAN_SUCCESS);
|
|
|
|
|
TESTASSERT(rrc_nr_conn_setup_test() == SRSRAN_SUCCESS);
|
|
|
|
|
TESTASSERT(rrc_write_pdu_bcch_dlsch_test() == SRSRAN_SUCCESS);
|
|
|
|
|
TESTASSERT(rrc_write_pdu_test() == SRSRAN_SUCCESS);
|
|
|
|
|
|
|
|
|
|
return SRSRAN_SUCCESS;
|
|
|
|
|
}
|
|
|
|
|