Commit 9fd1b9ac authored by Robert Schmidt's avatar Robert Schmidt

Correct buffer size for do_NR_DLInformationTransfer()

uper_encode_to_buffer() of asn1c returns the number of BITS that have
been encoded; if we use this, we need to calculate the resulting number
of bytes (rounding up) to get the right buffer size.

Note that do_NR_ULInformationTransfer() uses
uper_encode_to_new_buffer() which returns the number of BYTES, hence, in
this similar function, we should not modify the return value.
parent 82bd07eb
...@@ -941,7 +941,7 @@ uint8_t do_NR_DLInformationTransfer(uint8_t *buffer, ...@@ -941,7 +941,7 @@ uint8_t do_NR_DLInformationTransfer(uint8_t *buffer,
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_NR_DL_DCCH_Message, &dl_dcch_msg); ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_NR_DL_DCCH_Message, &dl_dcch_msg);
LOG_D(NR_RRC, "DLInformationTransfer Encoded %zd bytes\n", r.encoded); LOG_D(NR_RRC, "DLInformationTransfer Encoded %zd bytes\n", r.encoded);
// for (int i=0;i<encoded;i++) printf("%02x ",(*buffer)[i]); // for (int i=0;i<encoded;i++) printf("%02x ",(*buffer)[i]);
return r.encoded; return (r.encoded + 7) / 8;
} }
uint8_t do_NR_ULInformationTransfer(uint8_t **buffer, uint32_t pdu_length, uint8_t *pdu_buffer) { uint8_t do_NR_ULInformationTransfer(uint8_t **buffer, uint32_t pdu_length, uint8_t *pdu_buffer) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment