%% Decode BLE LL Data Channel PDU Given in Bits
% Create a BLE LL data channel PDU configuration object by using default settings and view the corresponding applicable properties.

cfgLLData = bleLLDataChannelPDUConfig

% Initialize and set the LLID value to 'start fragment/complete' indicating the BLE LL data channel PDU with the upper-layer payload. Initialize the cyclic redundancy check (CRC) value to 'ED321C'.

cfgLLData.LLID = 'Data (start fragment/complete)';
cfgLLData.CRCInitialization = 'ED321C';
crcInit = 'ED321C'; % CRC initialization value

% Generate the BLE LL data channel PDU with upper-layer payload given in hexadecimal octets.

pdu = bleLLDataChannelPDU(cfgLLData,'030004000A0100');

% Decode the generated BLE LL data channel PDU. The returned status indicates decoding is successful. View the output of 'status', 'cfgLLData' and 'llPayload'.

[status, cfgLLData, llPayload] = bleLLDataChannelPDUDecode(pdu,crcInit)

% Copyright 2019 The MathWorks, Inc.
%