Hoernchen has submitted this change. ( https://gerrit.osmocom.org/c/osmo-trx/+/32950 )
Change subject: ms: pretty tx buf class ......................................................................
ms: pretty tx buf class
Change-Id: I96c5dd79426a52e7fff2df27bdaa3fae0c69491a --- M Transceiver52M/ms/ms_upper.cpp 1 file changed, 17 insertions(+), 4 deletions(-)
Approvals: pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified laforge: Looks good to me, approved
diff --git a/Transceiver52M/ms/ms_upper.cpp b/Transceiver52M/ms/ms_upper.cpp index 5b213f7..cae1893 100644 --- a/Transceiver52M/ms/ms_upper.cpp +++ b/Transceiver52M/ms/ms_upper.cpp @@ -72,6 +72,13 @@ struct internal_q_tx_buf { trxcon_phyif_burst_req r; uint8_t buf[148]; + internal_q_tx_buf() = default; + internal_q_tx_buf(const internal_q_tx_buf &) = delete; + internal_q_tx_buf &operator=(const internal_q_tx_buf &) = default; + internal_q_tx_buf(const struct trxcon::trxcon_phyif_burst_req *br) : r(*br) + { + memcpy(buf, (void *)br->burst, br->burst_len); + } }; using tx_queue_t = spsc_cond<8 * 1, internal_q_tx_buf, true, false>; using cmd_queue_t = spsc_cond<8 * 1, trxcon_phyif_cmd, true, false>; @@ -415,10 +422,7 @@ return 0; OSMO_ASSERT(br->burst != 0);
- trxcon::internal_q_tx_buf b; - b.r = *br; - memcpy(b.buf, (void *)br->burst, br->burst_len); - + trxcon::internal_q_tx_buf b(br); if (!g_exit_flag) trxcon::txq.spsc_push(&b); return 0;