4.4 BLE Virtual Sniffer

This document 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.

Introduction

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 4-56. 
ToolQty
WBZ351Curiosity Board1
Micro USB cable1

SDK Setup

  1. Getting Started with Software Development

Software Requirement

  1. Wireless Protocol Suite(WPS)
  2. Microchip_BLE_Sniffer_Tool

Developing an Application with BLE SNIFFER component using MPLAB Code Configurator(MCC)

This section describes the steps required by a user to integrate and use the BLE Virtual Sniffer component into any application.
Note: It is recommended that new users of MPLAB Code Configurator go through the overview of MCC. For more details on how to add/remove different components like peripheral support and other wireless functionality, go to MPLAB® Code Configurator (MCC).
  1. Create a new MCC Harmony Project. For more details on creating a new MCC Harmony project, refer to Creating a New MCC Harmony Project.
  2. Ensure that wireless_system_pic32cxbz_wbz repo is available locally in the H3 repo environment.
  3. 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.
  4. Drag BLE SNIFFER component from Device Resources to project graph area and accept all Dependencies or satisfiers(auto-activation components), select "Yes".
  5. BLE SNIFFER will automatically enable the BLE LOG FEATURE(Enable BLE Log option) inside Ble stack as shown in the figure.
  6. Connect the BLE SNIFFER with one of instances of SERCOM to satisfy the "UART" dependency of BLE SNIFFER.
  7. 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.
  8. Generate the code. For more details, refer to MPLAB Code Configurator(MCC) Code Generation .
  9. 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.
  10. Compile and Run the project in WBZ45x device.

Capturing and Parsing the HCI Sniffer Packets through Microchip BLE Sniffer Tool

  1. Ensure to install the Wireless Protocol Suite.
  2. Open the WPS installed location and copy the following files as illustrated in the figure.
    1. liveimport and LiveImportAPI.dll (available inside Executables->core as part of WPS installation).

    2. Microchip_BLE_Sniffer_Tool (available in the link in software section).
  3. 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"> (eg: Microchip_BLE_Virtual_Sniffer_Tool 23 921600) as illustrated in the following figure.
  4. Open WPS tool and virtual sniffing data capture option in the Startup page and select Start record as illustrated in the following figure.
  5. 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.