%% Write BLE User-Defined Custom Block to PCAPNG File
% Create a PCAPNG file writer object, specifying the name of the PCAPNG file.

pcapngObj = pcapngWriter('FileName','writeBLEcustomdata');

% Write the interface description block for Bluetooth low energy (BLE).

interfaceName = 'BLE interface';
bleLinkType = 251;
interfaceId = writeInterfaceDescriptionBlock(pcapngObj,bleLinkType, ...
    interfaceName);

% Write the custom block to specify user-defined data.

writeCustomBlock(pcapngObj,"This block writes user-defined data");

% Copyright 2020 The MathWorks, Inc.