%% End-to-End Workflow of BLE L2CAP Frames
% Create a BLE L2CAP configuration object, 'bleL2CAPFrameConfig', to generate a BLE L2CAP data frame (B-frame). Set the value of channel identifier as'0004' and view the corresponding applicable properties.

cfgTx = bleL2CAPFrameConfig('ChannelIdentifier','0004')

% Generate a BLE L2CAP data frame (B-frame) with service data unit (SDU) from ATT specified as '0A0100'.

l2capFrame = bleL2CAPFrame(cfgTx,"0A0100")

% Decode the generated BLE L2CAP data frame (B-frame). The returned status indicates decoding was successful. View the output of 'status', 'cfgRx' and 'SDU'.

[status, cfgRx, SDU] = bleL2CAPFrameDecode(l2capFrame)

% Copyright 2019 The MathWorks, Inc.