%% Deaggregate VHT-Format A-MPDU
% Deaggregate a very-high-throughput-format (VHT-format) A-MPDU specified in bit form.
% Create a WLAN MAC frame configuration object, specifying the frame type and format.

cfgMAC =  wlanMACFrameConfig('FrameType','QoS Data','FrameFormat','VHT');

% Create a VHT-format configuration object with default settings.

cfgPHY = wlanVHTConfig;

% Create a random payload of eight MSDUs and use it to generate an A-MPDU in octet form.

payload = repmat({randi([0 255],1,40)},1,8);
ampduOctets = wlanMACFrame(payload,cfgMAC,cfgPHY);

% Convert the A-MPDU to bit form.

ampdu = reshape(de2bi(hex2dec(ampduOctets),8)',[],1);

% Return the list of MPDUs by deaggregating the A-MPDU.

[mpduList,delimiterCRCFail,status] = wlanAMPDUDeaggregate(ampdu,cfgPHY);

% Copyright 2018 The MathWorks, Inc.