Fix pack/unpack of SRS Report TLV value.

Since report_tlv->length is in bytes, and the value is an array of uint32_t, the number of uint32_t to be pushed/pulled is (length + 3) /4.
This commit is contained in:
Rúben Soares Silva
2024-11-29 09:15:04 +01:00
committed by Robert Schmidt
parent 36f65160fd
commit 91a75fe453
+4 -4
View File
@@ -2603,13 +2603,13 @@ static uint8_t pack_nr_srs_report_tlv(nfapi_srs_report_tlv_t *report_tlv, uint8_
push32(report_tlv->length, ppWritePackedMsg, end))) {
return 0;
}
for(int i = 0; i < report_tlv->length; i++) {
#ifndef ENABLE_AERIAL
for (int i = 0; i < (report_tlv->length + 3) / 4; i++) {
if (!push32(report_tlv->value[i], ppWritePackedMsg, end)) {
return 0;
}
}
#endif
return 1;
}
@@ -4569,7 +4569,7 @@ static uint8_t unpack_nr_srs_report_tlv(nfapi_srs_report_tlv_t *report_tlv, uint
return 0;
}
for(int i = 0; i < report_tlv->length; i++) {
for (int i = 0; i < (report_tlv->length + 3) / 4; i++) {
if (!pull32(ppReadPackedMsg, &report_tlv->value[i], end)) {
return 0;
}