nrMACBSRDecode
Description
[
decodes the buffer status report (BSR) medium access control (MAC) control element (CE). The
input, lcgID
,lcgBufferRange
] = nrMACBSRDecode(lcid
,bsr
)lcid
, specifies the logical channel ID (LCID) corresponding to
the specified input bsr
. The function returns the decoded logical
channel group (LCG) IDs, lcgID
, reported in the BSR, as well as the
buffer size range, lcgBufferRange
, for the values specified in the
BSR.
Examples
Generate and Decode BSR MAC CE
Specify the LCG buffer size, the LCG priority, and the number of padding bytes available for generating a padding BSR.
lcgBufferSize = [234 63 943 1002 4325 994 666 48]; % In bytes lcgPriority = [4 3 2 6 7 2 8 1]; paddingBytes = 2; % In bytes
Generate a padding BSR MAC CE for multiple LCGs by using the nrMACBSR
function. This function generates a short truncated BSR with the buffer information from LCG index 7.
[lcid,bsr] = nrMACBSR(lcgBufferSize,lcgPriority,paddingBytes)
lcid = 59
bsr = 230
Decode the LCG ID and the buffer size range of the BSR MAC CE by using the generated LCID and BSR values. The LCG ID output specifies the buffer information reported in LCG index 7.
[lcgID,lcgBufferRange] = nrMACBSRDecode(lcid,bsr)
lcgID = 7
lcgBufferRange = 1×2
39 53
Decode Short BSR MAC CE
Specify the LCID and BSR MAC CE of a short BSR.
lcid = 61; bsr = 67;
Decode the LCG ID and the buffer size range.
[lcgID,lcgBufferRange] = nrMACBSRDecode(lcid,bsr)
lcgID = 2
lcgBufferRange = 1×2
15 20
Decode Long and Long Truncated BSR MAC CE
Specify the LCID and BSR MAC CE of a long BSR.
lcid = 62; bsr = [36; 75; 253];
Decode the LCG ID and the buffer size range of a long BSR. The function returns the indices of the LCG whose buffer status was reported and contains data for transmission. The LCG buffer range specifies the corresponding buffer size range of the LCG IDs. In a long BSR, the function maps the LCG ID and LCG buffer ranges on a one-to-one basis.
[lcgID,lcgBufferRange] = nrMACBSRDecode(lcid,bsr)
lcgID = 2×1
2
5
lcgBufferRange = 2×2
1052 1119
76380420 81338368
Now, specify the LCID and BSR MAC CE of a long truncated BSR.
lcid = 60; bsr = [145; 51; 26];
Decode the LCG ID and the buffer size range of a long truncated BSR. The function returns the indices of the LCG containing data for transmission. The LCG buffer range specifies the buffer size range of the LCG IDs whose buffer status was reported. In a long truncated BSR, the function does not map the LCG ID and LCG buffer ranges on a one-to-one basis.
[lcgID,lcgBufferRange] = nrMACBSRDecode(lcid,bsr)
lcgID = 3×1
0
4
7
lcgBufferRange = 2×2
234 248
50 52
Now, for a long truncated BSR, specify the BSR containing one octet. This octet specifies the LCG bitmap.
lcid = 60; bsr = 17;
Decode the LCG ID and the buffer size range.
[lcgID,lcgBufferRange] = nrMACBSRDecode(lcid,bsr)
lcgID = 2×1
0
4
lcgBufferRange = 0x2 empty double matrix
Input Arguments
lcid
— Logical channel ID of BSR
integer in the range [59, 62]
Logical channel ID of the BSR, specified as an integer in the range [59, 62]. The integers in this range correspond to BSR MAC formats.
lcid Value | BSR Format |
---|---|
59 | Short truncated BSR |
60 | Long truncated BSR |
61 | Short BSR |
62 | Long BSR |
Data Types: double
bsr
— BSR MAC CE
nonnegative integer in the range [0, 255] | column vector of octets in the range [0, 255]
BSR MAC CE, specified as one of these values.
bsr Value | BSR Format Supported |
---|---|
Nonnegative integer in the range [0, 255] | Use this value for short and short truncated BSR formats. |
Column vector of octets in the range [0, 255] | Use this value for long and long truncated BSR formats.
|
The function uses this value to calculate the number of reported LCGs.
Data Types: double
Output Arguments
lcgID
— Logical channel group ID
integer | column vector
Logical channel group ID, returned as an integer or a column vector with length equal to the number of LCGs reported.
For a short BSR, short truncated BSR, and long BSR, this output returns the index of the logical channels whose buffer status was reported by
bsr
.For a long truncated BSR, this output returns the index of the logical channels that contains data for transmission.
Data Types: double
lcgBufferRange
— Buffer size range of LCGs
row vector | matrix
Buffer size range of the LCGs, returned as a row vector or a matrix. The first and second column of this output specify the lower and upper range of the buffer size, respectively.
BSR Format | lcgBufferRange Value
Description |
---|---|
Short or short truncated BSR |
|
Long BSR |
|
Long truncated BSR |
|
For more information about the buffer size range of the LCGs, see Section 6.1.3.1 of 3GPP TS 38.321 [1].
Data Types: double
References
[1] 3GPP TS 38.321. “NR; Medium Access Control (MAC) protocol specification.” 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Version History
Introduced in R2022a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)