This section explains how to use the MPLAB Code Configurator(MCC) framework to add BLE Virtual
Sniffer system service component for capturing the BLE HCI packets and feed it to the
sniffer tool for debugging purposes.
The BLE Virtual Sniffer uses BLE LOG middleware available as part of the BLE Stack (BLE
stack dependency) for restructuring of the HCI protocol packets. The BLE Virtual Sniffer
has dependency of UART (to Output the HCI packet) which can be satisfied through Harmony
SERCOM Plib (UART).
Hardware Requirement
Table 5-73. Hardware Prerequisites
S. No.
Tool
Quantity
1
WBZ351Curiosity Board
1
2
Micro USB cable
1
SDK Setup
Refer to Getting Started with Software Development from Related Links.
Developing an Application with BLE
SNIFFER component using MPLAB Code Configurator (MCC)
Follow the steps below to build the application manually:
Note: It is recommended for the new users of the MPLAB Code Configurator to refer
MPLAB® Code Configurator (MCC) User’s Guide
in Reference Documentation from Related Links.
Create a new harmony project. For more details, see Creating a New MCC
Harmony Project from Related Links.
Ensure that wireless_system_pic32cxbz_wbz repo is available locally in the
H3 repo environment.
Open MCC. The Wireless System Service components will be displayed .
In Device Resources, click Wireless and select System Services from
the drop down. The following image illustrates the steps.
Drag BLE SNIFFER component from Device Resources to project graph area
and accept all Dependencies or satisfiers (auto-activation components),
select Yes.
BLE SNIFFER will automatically enable the BLE LOG FEATURE(Enable BLE Log
option) inside BLE stack as shown in the figure.
Connect the BLE SNIFFER with one of instances of SERCOM to satisfy the
“UART” dependency of BLE SNIFFER.
Ensure that the Transmit pinout and Receive pinout settings are
configured properly inside SERCOM plib configuration options as shown in
the figure.
Note: Refer device data sheet for pin and
pad configurations.
For more details on code generation, refer to MPLAB Code Configurator
(MCC) Code Generation from Related Links.
After generating the program source from MCC interface by clicking
Generate Code, the BLE LOG application service can be found in the
following project directories.
Compile and Run the project in WBZ351 device.
Capturing and Parsing the HCI Sniffer Packets through Microchip BLE Sniffer Tool
Ensure to install the Wireless Protocol
Suite.
Open the WPS installed location and copy the
following files as illustrated in the figure.
liveimport and LiveImportAPI.dll (available inside
Executables->core as part of WPS installation).
Microchip_BLE_Sniffer_Tool (available in the link in software
section).
Open command prompt from the
WPS installed location and run Microchip_BLE_Sniffer_Tool using the
following command Microchip_BLE_Virtual_Sniffer_Tool.exe <“com_port”
<“Baud_Rate"” (Example: Microchip_BLE_Virtual_Sniffer_Tool 23 921600) as
illustrated in the following figure.
Open WPS tool and virtual sniffing data capture option in the Startup
page and select Start record as illustrated in the following
figure.
Reset the WBZ351 device and the captured packet
will appear in WPS Tool and the total number HCI packets captured will
be displayed in the Microchip_BLE_Sniffer_Tool command prompt as
illustrated in the figure.