CC2540EMK-USB dongle Starting from version 7.16.0.0 Wireless Communication Library Bluetooth Framework includes the wclBleSniffer - the class that allows your application to capture Raw Bluetooth LE Frames. It allows to capture not only Bluetooth LE advertisements but complete data exchange between Bluetooth LE central (client) and peripheral (server) devices including control and data frames.

PRE-REQUIREMENTS

HARDWARE

The BLE Sniffer requires CC2540 based Bluetooth LE USB dongle. It is recommended to use the CC2540EMK-USB TI dongle as it is shipped with pre-flashed required firmware. However you can use any China clone from AliExpress or any other CC2540 based USB dongle. The firmware can be found on the Texas Instruments size.

Drivers

It is required that the dongle uses WinUSB drivers. By default the dongle uses proprietary (Cebal) driver. Below you find the detailed instructions how to install WinUSB driver.

  • 1. Download Zadig.
  • 2. Start the Zaig application.
    Zadig Main Window
  • 3. Make sure that the List All Devices menu item is checked in the Options menu.
    Zadig List All Device Menu Item
  • 4. Select CC2540 USB Dongle in the drop down list box
    CC2540 USB Driver selection
  • 5. Make sure that the source driver is cebal (blue circle on the picture above).
  • 6. Make sure that the target driver is WinUSB (green circle on the picture above).
  • 7. Click the Replace Driver button.
    Zadig WinUSB driver installing
  • 8. Once driver installation finished you will see the "The driver was installed successfully." message.
    Zadig WinUSB driver installed

Now you can use your CC2540 USB dongle to capture Bluetooth LE communications. To revert the original driver back:

  • 1. Open the Device Manager
  • 2. Find the CC2540 USB Dongle device under the USB Devices node.
  • 3. Delete the device.
  • 4. Refrsh devices. This re-found the device and installs the original Cebal driver.

How It Works

Bluetooth Framework includes the BleSniffer demo application that shows how to use new wclBleSniffer class. Starting from 7.16.1 the BleSniffer can parse advertising PDUs:

  • ADV_IND
  • ADV_DIRECT_IND
  • ADV_NONCONN_IND
  • SCAN_REQ
  • SCAN_RSP
  • CONNECT_IND
  • ADV_SCAN_IND

Data PDUs and any other unknown packets are reported as raw.

At startup you should provide the advertising channel number. It can be channel 37, 38 or 39. Once connection request captured the sniffer will automatically follows the channel changes to capture control and data frames.

Check out the BleSniffer demo application from Bluetooth Framework package to find out more details about how it works.