%% Decode BLE LL Data Channel PDU Given in Octets
% Specify a sample BLE LL data channel PDU in octets.

pdu = '030C00010000060000000A000000FCD2A6'; % Sample PDU in octets

% Initialize the CRC value.

crcInit = 'ED323C'; % CRC initialization value

% Decode the specified BLE LL data channel PDU by specifying 'InputFormat' to 'octets'. The specified PDU is a control PDU. The returned status indicates decoding is successful. View the output of 'status', 'cfgLLData' and 'llPayload'. You can see the decoded configuration of the specified PDU in the 'ControlConfig' property of 'cfgLLData'.

[status, cfgLLData, llPayload] = bleLLDataChannelPDUDecode(...
    pdu, crcInit, ...
    'InputFormat', ...
    'octets')

% Copyright 2019 The MathWorks, Inc.
%