Skip to main content
# HCI Protocol
This is a Python package for parsing and building HCI packets.

HCI (Host Controller Interface) is the protocol used for communications between a BT/BLE controller (i.e. USB dongle) and a host computer such as a RPi.
Currently **only part of the protocol is implemented in this package**

## Usage Examples
1. Hci Sniffer (Linux only): `python -m hci_protocol.hci_sniffer --hci 0`
2. Building a packet:
```python
from hci_protocol import hci_functions
hci_functions.create_le_connection_comlete_packet(peer_address='AA:BB:CC:DD:EE:FF', connection_handle=70)
# ==> '\x04>\x13\x01\x00F\x00\x00\x01\xff\xee\xdd\xcc\xbb\xaa8\x00\x00\x00*\x00\x00'
```

3. Parsing a packet:
```python
from hci_protocol.hci_protocol import HciPacket
print HciPacket.parse('\x04>\x13\x01\x00F\x00\x00\x01\xff\xee\xdd\xcc\xbb\xaa8\x00\x00\x00*\x00\x00')
# ==>
# Container:
# type = EVENT_PACKET (total 12)
# payload = Container:
# event = LE_META_EVENT (total 13)
# length = 19
# payload = Container:
# subevent = LE_CONNECTION_COMPLETED (total 23)
# payload = Container:
# status = 0
# handle = 70
# role = 0
# peer_bdaddr_type = 1
# peer_bdaddr = aa:bb:cc:dd:ee:ff (total 17)
# interval = 56
# latency = 0
# supervision_timeout = 42
# master_clock_accuracy = 0
```

## Contribute
This package is in a preliminary stage and there is still a lot of work to do. Feel free to fork and submit your pull requests.

For more information about the HCI protocol, check out the [Blutooth Core Specifications](https://www.bluetooth.org/DocMan/handlers/DownloadDoc.ashx?doc_id=421043&_ga=2.29692863.121228451.1498147116-1432843607.1484151012)

Metadata

Release files for hci-protocol 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hci-protocol 0.0.5
File Size Uploaded
hci-protocol-0.0.5.tar.gz 11.8 kB Details

Release files / hci-protocol-0.0.5.tar.gz

Download URL hci-protocol-0.0.5.tar.gz
Size 11.8 kB
Tags Source
SHA-256 checksum
How to use checksums
99498e7c9c6b5dd18c7a9a9bd3145f3922bfc123aadc38a68943a981b91d4489
BLAKE2b-256 checksum
How to use checksums
aaa18e6ecbb4f3e0db4bc941b18d5c19fa90817f87e9db0d98dca0e33e2f3d44
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.0.5 This release

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page