From fc1b3e6c9076ddc38e07715b2cc30319bac19b9c Mon Sep 17 00:00:00 2001 From: Jacob Erlbeck Date: Mon, 11 Jan 2016 09:58:11 +0100 Subject: edge: Fix RLC message size Currently the RLC message length that is obtained from the DSP is reduced by 1 if the last byte of the buffer includes spare bits. While this worked well with GPRS, these bits are being used to encode RLC blocks in EGPRS mode. Thus this last byte must not be chopped off. The functionality of the code is not affected by this, since the modified length value is not used. This commit adds GprsCodingScheme::usedSizeDL/UL to return the number of bytes needed to encode the message block. If there are single bits at the end that are to be used (EGPRS), the functions return the number of full bytes plus 1 (which is the buffer size reported by the DSP and returned by sizeUL/sizeDL). The commit also removes the len parameter from rcv_data_block_acknowledged. Sponsored-by: On-Waves ehf --- tests/edge/EdgeTest.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/edge/EdgeTest.cpp b/tests/edge/EdgeTest.cpp index dffd009d..b26262ca 100644 --- a/tests/edge/EdgeTest.cpp +++ b/tests/edge/EdgeTest.cpp @@ -49,15 +49,15 @@ static void check_coding_scheme(GprsCodingScheme& cs, GprsCodingScheme::Mode mod OSMO_ASSERT(cs.isCompatible(mode)); /* Check static getBySizeUL() */ - expected_size = cs.maxBytesUL(); - if (cs.spareBitsUL() > 0) + expected_size = cs.usedSizeUL(); + if (cs.spareBitsUL() > 0 && cs.isGprs()) expected_size += 1; OSMO_ASSERT(expected_size == cs.sizeUL()); OSMO_ASSERT(cs == GprsCodingScheme::getBySizeUL(expected_size)); /* Check static sizeUL() */ - expected_size = cs.maxBytesDL(); - if (cs.spareBitsDL() > 0) + expected_size = cs.usedSizeDL(); + if (cs.spareBitsDL() > 0 && cs.isGprs()) expected_size += 1; OSMO_ASSERT(expected_size == cs.sizeDL()); -- cgit v1.2.3