From 63f1ea1bec21ee21097729e5d80d7b76a5488a2c Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Mon, 29 Jun 2020 09:29:13 +0200 Subject: [PATCH] ttcn3: streamline DRB and SRB Tx interface use the same tx interface with const uint8_t* and length byte instead of std::string --- srsue/test/ttcn3/hdr/ttcn3_srb_interface.h | 7 +++---- srsue/test/ttcn3/src/ttcn3_syssim.cc | 4 +--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/srsue/test/ttcn3/hdr/ttcn3_srb_interface.h b/srsue/test/ttcn3/hdr/ttcn3_srb_interface.h index 73c2d7717..91ef6c9f5 100644 --- a/srsue/test/ttcn3/hdr/ttcn3_srb_interface.h +++ b/srsue/test/ttcn3/hdr/ttcn3_srb_interface.h @@ -49,12 +49,11 @@ public: return port_listen(); } - void tx(std::string out) + void tx(const uint8_t* buffer, uint32_t len) { if (initialized) { - log->info_hex( - reinterpret_cast(out.c_str()), out.length(), "Sending %ld B to Titan\n", out.length()); - send(reinterpret_cast(out.c_str()), out.length()); + log->info_hex(buffer, len, "Sending %d B to Titan\n", len); + send(buffer, len); } else { log->error("Trying to transmit but port not connected.\n"); } diff --git a/srsue/test/ttcn3/src/ttcn3_syssim.cc b/srsue/test/ttcn3/src/ttcn3_syssim.cc index 3d1a972d5..77e99fc9b 100644 --- a/srsue/test/ttcn3/src/ttcn3_syssim.cc +++ b/srsue/test/ttcn3/src/ttcn3_syssim.cc @@ -1026,11 +1026,9 @@ void ttcn3_syssim::write_pdu(uint32_t lcid, unique_byte_buffer_t pdu) // push content to Titan if (lcid <= 2) { std::string out = ttcn3_helpers::get_rrc_pdu_ind_for_pdu(tti, lcid, cells[pcell_idx]->name, std::move(pdu)); - - srb.tx(out); + srb.tx(reinterpret_cast(out.c_str()), out.length()); } else { std::string out = ttcn3_helpers::get_drb_common_ind_for_pdu(tti, lcid, cells[pcell_idx]->name, std::move(pdu)); - log->error("DRB send:\n%s", out.c_str()); drb.tx(reinterpret_cast(out.c_str()), out.length()); } }