PCAP file writer of protocol packets
pcapWriter object writes generated and recovered protocol
packets to a packet capture (PCAP) file (
You can write these packet types to a PCAP file:
Generated and recovered WLAN protocol packets
Generated and recovered 5G NR protocol packets (requires 5G Toolbox™)
Generated and recovered Bluetooth® low energy (BLE) link layer (LL) packets (requires Communications Toolbox™ Library for the Bluetooth Protocol)
pcapWriter object does not overwrite the existing PCAP file. During
each call of this object, specify a unique PCAP file name.
FileName — Name of the PCAP file
'capture' (default) | character row vector | string scalar
Name of the PCAP file, specified as a character row vector or a string scalar.
ByteOrder — Byte order
'little-endian' (default) |
Byte order, specified as
Write WLAN Packet to PCAP File
Create a PCAP file writer object, specifying the name of the PCAP file. Specify the link type for WLAN packet.
pcapObj = pcapWriter('FileName','writeWLANpacketdata2'); wlanLinkType = 105;
Write a global header to the PCAP file.
Specify a WLAN packet.
mpdu = 'B4000000FFFFFFFFFFFF00123456789BA79A5B28';
Write the WLAN packet to the PCAP file.
timestamp = 124800; % Number of microseconds write(pcapObj,mpdu,timestamp);
 “Radiotap - Introduction.” Accessed May 20, 2020. https://www.radiotap.org/.
 Group, The Tcpdump. “Tcpdump/Libpcap Public Repository.” Accessed May 20, 2020. https://www.tcpdump.org.
 “Development/LibpcapFileFormat - The Wireshark Wiki.” Accessed May 20, 2020. https://www.wireshark.org.