BLE testing toolkit built on Bumble with interactive menu, GATT ops, and HCI capture
Project description
Bumble BLE Testing Framework
A comprehensive BLE (Bluetooth Low Energy) testing toolkit built on the Bumble Bluetooth stack
Features:
- ๐ Interactive menu-driven interface
- ๐ก BLE scanning and device discovery
- ๐ GATT operations (read/write/notify)
- ๐ Pairing and persistent bonding
- ๐ Live HCI packet capture (Ellisys + BTSnoop)
- ๐ Python API for automation
๐ Start Guide
Choose one workflow:
Option A: Install from Package/Release (Fastest)
If you install the package (for example pip install HCIEMU), these commands are available:
Install method recommendation:
- Use
pipinside a virtual environment for project development and reproducible dependencies. - Use
pipxfor global command-line usage (HCI,BRIDGE) without polluting system Python.
Examples:
# Inside an active venv
pip install HCIEMU
# Global CLI install (isolated)
pipx install HCIEMU
HCI- Launch the interactive menu app.BRIDGE- Launch bridge with defaults (usb:0->tcp-server:127.0.0.1:9001).BRIDGE <source> <target>- Launch bridge with custom endpoints.hciemu- Alias ofHCI.bumble-hci-menu- Alias ofHCI.
Windows example:
# Terminal 1
BRIDGE
# Terminal 2
HCI
Custom bridge example:
BRIDGE serial:COM5,115200 tcp-server:127.0.0.1:9001
Option B: Clone the Repository (Development/Source Mode)
git clone <repository-url>
cd bumble_hci
Windows quick run:
setup.bat
BRIDGE.bat
HCI.bat
Source-mode commands also work directly:
python src/main.py
bumble-hci-bridge usb:0 tcp-server:127.0.0.1:9001
Linux/macOS setup details: SETUP.md
๐ Documentation
For Users:
- docs/USER_MANUAL.md - Complete usage guide, troubleshooting, FAQ
For Developers:
- docs/TECHNICAL_REFERENCE.md - Architecture, APIs, protocols
Setup & Contributing:
- SETUP.md - Platform-specific installation
- CONTRIBUTING.md - How to contribute
๐ Project Structure
bumble_hci/
โโโ ๐ README.md โ You are here
โโโ ๐ requirements.txt โ Python dependencies
โโโ ๐ setup.py โ Package configuration
โโโ ๐ง setup.bat โ First-time setup (Windows)
โโโ ๐ง run.bat โ Run application (Windows)
โ
โโโ ๐ src/ โ Application source code
โ โโโ main.py โ Main interactive menu
โ โโโ connector.py โ BLE operations
โ โโโ scanner.py โ Device scanning
โ โโโ hci_snooper.py โ HCI packet capture
โ โโโ utils.py โ Utilities
โ
โโโ ๐ docs/ โ Documentation
โ โโโ USER_MANUAL.md โ User guide (START HERE!)
โ โโโ TECHNICAL_REFERENCE.md โ Developer guide
โ โโโ development/ โ Historical dev docs
โ
โโโ ๐ examples/ โ Code examples
โ โโโ basic_connection.py
โ โโโ scan_devices.py
โ โโโ hci_capture.py
โ
โโโ ๐ tests/ โ Test suite
โโโ ๐ scripts/ โ Utility scripts
โโโ ๐ configs/ โ Configuration files
โ โโโ bumble_bonds.json โ Persistent bonds
โโโ ๐ logs/ โ HCI captures & logs
โโโ ๐ resources/ โ UUID lookups, configs
๐ฏ Key Features
BLE Operations
- Scan - Discover nearby BLE devices with RSSI
- Connect - Establish connections to BLE peripherals
- GATT - Browse services, read/write characteristics
- Notify - Subscribe to characteristic notifications
Apple Services
- ANCS - Apple Notification Center Service: receive and act on iOS notifications
- AMS - Apple Media Service: monitor and control iOS media playback
Security & Bonding
- Pairing - Support for multiple pairing methods
- Bonding - Persistent bond storage (survives restart)
- Encryption - Manual encryption control
- SMP Security Request - Initiate security from the peripheral side
HCI Packet Capture
- Live Capture - Real-time HCI packet streaming
- Ellisys Integration - UDP injection for Ellisys Bluetooth Analyzer
- BTSnoop Format - Standard .log/.btsnoop file output
- Protocol Analysis - Decode and analyze BLE protocol
Developer Tools
- Python API - Programmatic access to all features
- Examples - Ready-to-use code samples
- Rich UI - Colorful terminal interface with tables
๐ก Usage Examples
Interactive Menu
python src/main.py
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
BUMBLE BLE Testing - Main Menu
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
[1] Scan for BLE Devices
[2] Connect to Device
[3] Disconnect
--- ATT / GATT (21-40) ---
[21] Discover GATT Services
[22] Read Characteristic
[23] Write Characteristic
[35] Apple Services (ANCS / AMS)
--- SMP (41-50) ---
[41] Pair / Encrypt Connection
[42] Send SMP Security Request
[43] SMP Settings
[44] Unpair / Delete Bonding
--- Advertising (51-60) ---
[51] Advertising Menu
--- L2CAP (61-80) ---
[61] L2CAP Operations (CBFC/ECBFC)
Programmatic Usage
See examples/ for complete code samples:
from connector import BLEConnector
# Scan for devices
connector = BLEConnector("tcp-client:127.0.0.1:9001")
devices = await connector.scan(duration=10)
# Connect and read
await connector.connect("AA:BB:CC:DD:EE:FF")
value = await connector.read_characteristic(0x0012)
๐ ๏ธ Requirements
- Python 3.8+
- Bluetooth USB adapter (or built-in Bluetooth)
- USB driver: WinUSB (Windows - via Zadig)
- Bumble - Installed via
pip install bumble
See SETUP.md for complete requirements and installation.
๐ฆ Installation
Quick Install (Windows)
# Clone repository
git clone <repository-url>
cd bumble_hci
# Run setup
setup.bat
Manual Install (Any Platform)
# Create virtual environment
python -m venv venv
source venv/bin/activate # Linux/macOS
# or
venv\Scripts\activate.ps1 # Windows
# Install dependencies
pip install -r requirements.txt
Full instructions: SETUP.md
๐ง Configuration
HCI Transport
Default: tcp-client:127.0.0.1:9001
Requires bumble-hci-bridge running:
bumble-hci-bridge usb:0 tcp-server:127.0.0.1:9001
Bond Storage
Bonds saved to: configs/bumble_bonds.json
HCI Capture
Files saved to: logs/hci_capture.log (BTSnoop format)
Ellisys: UDP port 24352
๐งช Testing
# Run all tests
python -m pytest tests/
# Run specific test
python tests/test_connection.py
python tests/test_ellisys_udp.py
# Check bonding status
python scripts/check_bonding.py
๐ Learn More
Documentation:
- User Manual - How to use the framework
- Technical Reference - How it works
Guides:
- Setup Guide - Installation for Windows/Linux/macOS
- Contributing - How to contribute
Examples:
- examples/scan_devices.py - Scan for BLE devices
- examples/basic_connection.py - Connect and read
- examples/hci_capture.py - Capture HCI packets
๐ค Contributing
Contributions welcome! See CONTRIBUTING.md
๐ License
MIT License - see LICENSE
๐ Acknowledgments
Built with Bumble - A Python Bluetooth stack by Google
Questions? Check the FAQ or open an issue.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hciemu-1.2.0.tar.gz.
File metadata
- Download URL: hciemu-1.2.0.tar.gz
- Upload date:
- Size: 92.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
810aae1f55886108f1dd5817f42496308d64109631d07f61ae9f2a3c1726bdc9
|
|
| MD5 |
96029b8aa46b0b72d7c3e61330438603
|
|
| BLAKE2b-256 |
e1a5c41b40115c9840f82036afb15cc30f0a222ddefc792dda6b6c3584f692ca
|
Provenance
The following attestation bundles were made for hciemu-1.2.0.tar.gz:
Publisher:
publish.yml on demoham-x/hci_emu
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hciemu-1.2.0.tar.gz -
Subject digest:
810aae1f55886108f1dd5817f42496308d64109631d07f61ae9f2a3c1726bdc9 - Sigstore transparency entry: 1326523589
- Sigstore integration time:
-
Permalink:
demoham-x/hci_emu@b5bf2ad61646524d9fed556b1bd172603d39e91c -
Branch / Tag:
refs/tags/release-1.2.0 - Owner: https://github.com/demoham-x
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b5bf2ad61646524d9fed556b1bd172603d39e91c -
Trigger Event:
push
-
Statement type:
File details
Details for the file hciemu-1.2.0-py3-none-any.whl.
File metadata
- Download URL: hciemu-1.2.0-py3-none-any.whl
- Upload date:
- Size: 92.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
22ea35dbdfc1adf169fb61bdece1b3dc22cf1b518929be6c4dd65ed7abb0f6ed
|
|
| MD5 |
1add199a3842f4819bdee8ad9a2dad67
|
|
| BLAKE2b-256 |
8a510bd968d138d4b40605837adc98626ccbee40b2c30c83d0997c399899c068
|
Provenance
The following attestation bundles were made for hciemu-1.2.0-py3-none-any.whl:
Publisher:
publish.yml on demoham-x/hci_emu
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hciemu-1.2.0-py3-none-any.whl -
Subject digest:
22ea35dbdfc1adf169fb61bdece1b3dc22cf1b518929be6c4dd65ed7abb0f6ed - Sigstore transparency entry: 1326524002
- Sigstore integration time:
-
Permalink:
demoham-x/hci_emu@b5bf2ad61646524d9fed556b1bd172603d39e91c -
Branch / Tag:
refs/tags/release-1.2.0 - Owner: https://github.com/demoham-x
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b5bf2ad61646524d9fed556b1bd172603d39e91c -
Trigger Event:
push
-
Statement type: