%% Deaggregate VHT A-MPDU
% Create a WLAN MAC frame configuration object, specifying the frame type and frame format.

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

% Create a VHT configuration object with default settings.

cfgPHY = wlanVHTConfig;

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

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

% Deaggregate the A-MPDU.

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

% Confirm successful deaggregation by displaying the result of the delimiter CRC and the decoding status.

disp(failCRC)
disp(status)

% Copyright 2018 The MathWorks, Inc.