seemoo-lab / internalblue

Bluetooth experimentation framework for Broadcom and Cypress chips.
678 stars 85 forks source link

Add HCI_CHANNEL_USER socket to hcicore #56

Closed ttdennis closed 2 years ago

ttdennis commented 2 years ago

This PR implements an HCI_CHANNEL_USER HCI socket.

TL;DR; The HCI_CHANNEL_USER allows exclusive access to the HCI device and the kernel will not interfere.

I just stuffed this as an alternative into the hcicore.py as only the setup of the socket differs. You can specify user_channel=True when creating a new hcicore. The setup of the socket cannot be done with Python's socket implementation so it uses cpython. The code is largely taken from scapy.