diff --git a/srsue/hdr/stack/upper/rrctl.h b/srsue/hdr/stack/upper/rrctl.h index ca791d7fd..48cde2dfb 100644 --- a/srsue/hdr/stack/upper/rrctl.h +++ b/srsue/hdr/stack/upper/rrctl.h @@ -228,10 +228,10 @@ public: explicit error(const std::string& msg) : std::runtime_error(msg) {}; }; -void enc_hdr(srslte::byte_buffer_t& buf, - proto::msg_type type, - proto::msg_disc disc, - uint16_t len = 0); +struct proto::msg_hdr* enc_hdr(srslte::byte_buffer_t& buf, + proto::msg_type type, + proto::msg_disc disc, + uint16_t len = 0); const uint8_t* dec_hdr(const srslte::byte_buffer_t& buf, proto::msg_type& type, proto::msg_disc& disc, diff --git a/srsue/src/stack/upper/rrctl.cc b/srsue/src/stack/upper/rrctl.cc index 84570a5e1..280bf44cc 100644 --- a/srsue/src/stack/upper/rrctl.cc +++ b/srsue/src/stack/upper/rrctl.cc @@ -102,10 +102,10 @@ std::string msg_hdr_desc(proto::msg_type type, proto::msg_disc disc, uint16_t le namespace codec { -void enc_hdr(srslte::byte_buffer_t& buf, - proto::msg_type type, - proto::msg_disc disc, - uint16_t len) +struct proto::msg_hdr* enc_hdr(srslte::byte_buffer_t& buf, + proto::msg_type type, + proto::msg_disc disc, + uint16_t len) { struct proto::msg_hdr hdr = { #if defined(__LITTLE_ENDIAN_BITFIELD) @@ -121,6 +121,8 @@ void enc_hdr(srslte::byte_buffer_t& buf, }; buf.append_bytes((const uint8_t*) &hdr, sizeof(hdr)); + + return reinterpret_cast (&buf.msg[0]); } const uint8_t* dec_hdr(const srslte::byte_buffer_t& buf,