%% Generate QoS Data Frame
% Generate a QoS Data frame of length 2000 octets.
% Create a WLAN MAC frame configuration object.

macConfig = wlanMACFrameConfig('FrameType','QoS Data');

%  Calculate the MSDU lengths required to generate a 2000-octet QoS Data frame and display the result.

frameLength = 2000;
msduLengths = wlanMSDULengths(frameLength,macConfig);
disp(msduLengths)

%  Create a random payload of the obtained MSDU length.

msdu = randi([0 255],1,msduLengths);

% Generate the 2000-octet QoS data frame.

[frame,frameLength] = wlanMACFrame(msdu,macConfig);
disp(frameLength)

% Copyright 2018 The MathWorks, Inc.