srsue/rrctl: make codec::enc_hdr() return proto::msg_hdr
This commit is contained in:
parent
796a6df0df
commit
27344af7f0
|
@ -228,10 +228,10 @@ public:
|
||||||
explicit error(const std::string& msg) : std::runtime_error(msg) {};
|
explicit error(const std::string& msg) : std::runtime_error(msg) {};
|
||||||
};
|
};
|
||||||
|
|
||||||
void enc_hdr(srslte::byte_buffer_t& buf,
|
struct proto::msg_hdr* enc_hdr(srslte::byte_buffer_t& buf,
|
||||||
proto::msg_type type,
|
proto::msg_type type,
|
||||||
proto::msg_disc disc,
|
proto::msg_disc disc,
|
||||||
uint16_t len = 0);
|
uint16_t len = 0);
|
||||||
const uint8_t* dec_hdr(const srslte::byte_buffer_t& buf,
|
const uint8_t* dec_hdr(const srslte::byte_buffer_t& buf,
|
||||||
proto::msg_type& type,
|
proto::msg_type& type,
|
||||||
proto::msg_disc& disc,
|
proto::msg_disc& disc,
|
||||||
|
|
|
@ -102,10 +102,10 @@ std::string msg_hdr_desc(proto::msg_type type, proto::msg_disc disc, uint16_t le
|
||||||
|
|
||||||
namespace codec {
|
namespace codec {
|
||||||
|
|
||||||
void enc_hdr(srslte::byte_buffer_t& buf,
|
struct proto::msg_hdr* enc_hdr(srslte::byte_buffer_t& buf,
|
||||||
proto::msg_type type,
|
proto::msg_type type,
|
||||||
proto::msg_disc disc,
|
proto::msg_disc disc,
|
||||||
uint16_t len)
|
uint16_t len)
|
||||||
{
|
{
|
||||||
struct proto::msg_hdr hdr = {
|
struct proto::msg_hdr hdr = {
|
||||||
#if defined(__LITTLE_ENDIAN_BITFIELD)
|
#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));
|
buf.append_bytes((const uint8_t*) &hdr, sizeof(hdr));
|
||||||
|
|
||||||
|
return reinterpret_cast<struct proto::msg_hdr*> (&buf.msg[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint8_t* dec_hdr(const srslte::byte_buffer_t& buf,
|
const uint8_t* dec_hdr(const srslte::byte_buffer_t& buf,
|
||||||
|
|
Loading…
Reference in New Issue