forked from auracaster/bumble_mirror
add doc
This commit is contained in:
12
README.md
12
README.md
@@ -9,7 +9,7 @@
|
|||||||
Bluetooth Stack for Apps, Emulation, Test and Experimentation
|
Bluetooth Stack for Apps, Emulation, Test and Experimentation
|
||||||
=============================================================
|
=============================================================
|
||||||
|
|
||||||
<img src="docs/mkdocs/src/images/logo_framed.png" alt="drawing" width="200" height="200"/>
|
<img src="docs/mkdocs/src/images/logo_framed.png" alt="Logo" width="200" height="200"/>
|
||||||
|
|
||||||
Bumble is a full-featured Bluetooth stack written entirely in Python. It supports most of the common Bluetooth Low Energy (BLE) and Bluetooth Classic (BR/EDR) protocols and profiles, including GAP, L2CAP, ATT, GATT, SMP, SDP, RFCOMM, HFP, HID and A2DP. The stack can be used with physical radios via HCI over USB, UART, or the Linux VHCI, as well as virtual radios, including the virtual Bluetooth support of the Android emulator.
|
Bumble is a full-featured Bluetooth stack written entirely in Python. It supports most of the common Bluetooth Low Energy (BLE) and Bluetooth Classic (BR/EDR) protocols and profiles, including GAP, L2CAP, ATT, GATT, SMP, SDP, RFCOMM, HFP, HID and A2DP. The stack can be used with physical radios via HCI over USB, UART, or the Linux VHCI, as well as virtual radios, including the virtual Bluetooth support of the Android emulator.
|
||||||
|
|
||||||
@@ -38,12 +38,20 @@ python -m pip install ".[test,development,documentation]"
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
Refer to the [Example Documentation](examples/README.md) for details on the included example scripts and how to run them.
|
Refer to the [Examples Documentation](examples/README.md) for details on the included example scripts and how to run them.
|
||||||
|
|
||||||
The complete [list of Examples](/docs/mkdocs/src/examples/index.md), and what they are designed to do is here.
|
The complete [list of Examples](/docs/mkdocs/src/examples/index.md), and what they are designed to do is here.
|
||||||
|
|
||||||
There are also a set of [Apps and Tools](docs/mkdocs/src/apps_and_tools/index.md) that show the utility of Bumble.
|
There are also a set of [Apps and Tools](docs/mkdocs/src/apps_and_tools/index.md) that show the utility of Bumble.
|
||||||
|
|
||||||
|
### Using Bumble With a USB Dongle
|
||||||
|
|
||||||
|
Bumble is easiest to use with a dedicated USB dongle.
|
||||||
|
This is because internal Bluetooth interfaces tend to be locked down by the operating system.
|
||||||
|
You can use the [usb_probe](/docs/mkdocs/src/apps_and_tools/usb_probe.md) tool (all platforms) or `lsusb` (Linux or macOS) to list the available USB devices on your system.
|
||||||
|
|
||||||
|
See the [USB Transport](/docs/mkdocs/src/transports/usb.md) page for details on how to refer to USB devices.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
Licensed under the [Apache 2.0](LICENSE) License.
|
Licensed under the [Apache 2.0](LICENSE) License.
|
||||||
|
|||||||
38
docs/mkdocs/src/apps_and_tools/usb_probe.md
Normal file
38
docs/mkdocs/src/apps_and_tools/usb_probe.md
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
USB PROBE TOOL
|
||||||
|
==============
|
||||||
|
|
||||||
|
This tool lists all the USB devices, with details about each device.
|
||||||
|
For each device, the different possible Bumble transport strings that can
|
||||||
|
refer to it are listed.
|
||||||
|
If the device is known to be a Bluetooth HCI device, its identifier is printed
|
||||||
|
in reverse colors, and the transport names in cyan color.
|
||||||
|
For other devices, regardless of their type, the transport names are printed
|
||||||
|
in red. Whether that device is actually a Bluetooth device or not depends on
|
||||||
|
whether it is a Bluetooth device that uses a non-standard Class, or some other
|
||||||
|
type of device (there's no way to tell).
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
This command line tool takes no arguments.
|
||||||
|
When installed from PyPI, run as
|
||||||
|
```
|
||||||
|
$ bumble-usb-probe
|
||||||
|
```
|
||||||
|
|
||||||
|
When running from the source distribution:
|
||||||
|
```
|
||||||
|
$ python3 apps/usb-probe.py
|
||||||
|
```
|
||||||
|
|
||||||
|
!!! example
|
||||||
|
```
|
||||||
|
$ python3 apps/usb_probe.py
|
||||||
|
|
||||||
|
ID 0A12:0001
|
||||||
|
Bumble Transport Names: usb:0 or usb:0A12:0001
|
||||||
|
Bus/Device: 020/034
|
||||||
|
Class: Wireless Controller
|
||||||
|
Subclass/Protocol: 1/1 [Bluetooth]
|
||||||
|
Manufacturer: None
|
||||||
|
Product: USB2.0-BT
|
||||||
|
```
|
||||||
@@ -4,16 +4,56 @@ USB TRANSPORT
|
|||||||
The USB transport interfaces with a local Bluetooth USB dongle.
|
The USB transport interfaces with a local Bluetooth USB dongle.
|
||||||
|
|
||||||
## Moniker
|
## Moniker
|
||||||
The moniker for a USB transport is either `usb:<index>` or `usb:<vendor>:<product>`
|
The moniker for a USB transport is either:
|
||||||
with `<index>` as the 0-based index to select amongst all the devices that appear to be supporting Bluetooth HCI (0 being the first one), or where `<vendor>` and `<product>` are a vendor ID and product ID in hexadecimal.
|
* `usb:<index>`
|
||||||
|
* `usb:<vendor>:<product>`
|
||||||
|
* `usb:<vendor>:<product>/<serial-number>`
|
||||||
|
* `usb:<vendor>:<product>#<index>`
|
||||||
|
|
||||||
!!! example
|
with `<index>` as a 0-based index (0 being the first one) to select amongst all the matching devices when there are more than one.
|
||||||
|
In the `usb:<index>` form, matching devices are the ones supporting Bluetooth HCI, as declared by their Class, Subclass and Protocol.
|
||||||
|
In the `usb:<vendor>:<product>#<index>` form, matching devices are the ones with the specified `<vendor>` and `<product>` identification.
|
||||||
|
|
||||||
|
`<vendor>` and `<product>` are a vendor ID and product ID in hexadecimal.
|
||||||
|
|
||||||
|
!!! examples
|
||||||
`usb:04b4:f901`
|
`usb:04b4:f901`
|
||||||
Use the USB dongle with `vendor` equal to `04b4` and `product` equal to `f901`
|
The USB dongle with `<vendor>` equal to `04b4` and `<product>` equal to `f901`
|
||||||
|
|
||||||
`usb:0`
|
`usb:0`
|
||||||
Use the first Bluetooth dongle
|
The first Bluetooth HCI dongle that's declared as such by Class/Subclass/Protocol
|
||||||
|
|
||||||
|
`usb:04b4:f901/0016A45B05D8`
|
||||||
|
The USB dongle with `<vendor>` equal to `04b4`, `<product>` equal to `f901` and `<serial>` equal to `0016A45B05D8`
|
||||||
|
|
||||||
|
`usb:04b4:f901/#1`
|
||||||
|
The second USB dongle with `<vendor>` equal to `04b4` and `<product>` equal to `f901`
|
||||||
|
|
||||||
## Alternative
|
## Alternative
|
||||||
The library includes two different implementations of the USB transport, implemented using different python bindings for `libusb`.
|
The library includes two different implementations of the USB transport, implemented using different python bindings for `libusb`.
|
||||||
Using the transport prefix `pyusb:` instead of `usb:` selects the implementation based on [PyUSB](https://pypi.org/project/pyusb/), using the synchronous API of `libusb`, whereas the default implementation is based on [libusb1](https://pypi.org/project/libusb1/), using the asynchronous API of `libusb`. In order to use the alternative PyUSB-based implementation, you need to ensure that you have installed that python module, as it isn't installed by default as a dependency of Bumble.
|
Using the transport prefix `pyusb:` instead of `usb:` selects the implementation based on [PyUSB](https://pypi.org/project/pyusb/), using the synchronous API of `libusb`, whereas the default implementation is based on [libusb1](https://pypi.org/project/libusb1/), using the asynchronous API of `libusb`. In order to use the alternative PyUSB-based implementation, you need to ensure that you have installed that python module, as it isn't installed by default as a dependency of Bumble.
|
||||||
|
|
||||||
|
## Listing Available USB Devices
|
||||||
|
|
||||||
|
### With `usb_probe`
|
||||||
|
You can use the [`usb_probe`](../apps_and_tools/usb_probe.md) tool to list all the USB devices attached to your host computer.
|
||||||
|
The tool will also show the `usb:XXX` transport name(s) you can use to reference each device.
|
||||||
|
|
||||||
|
|
||||||
|
### With `lsusb`
|
||||||
|
On Linux and macOS, the `lsusb` tool serves a similar purpose to Bumble's own `usb_probe` tool (without the Bumble specifics)
|
||||||
|
|
||||||
|
#### Installing lsusb
|
||||||
|
|
||||||
|
On Mac: `brew install lsusb`
|
||||||
|
On Linux: `sudo apt-get install usbutils`
|
||||||
|
|
||||||
|
#### Using lsusb
|
||||||
|
|
||||||
|
```
|
||||||
|
$ lsusb
|
||||||
|
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
|
||||||
|
Bus 003 Device 014: ID 0b05:17cb ASUSTek Computer, Inc. Broadcom BCM20702A0 Bluetooth
|
||||||
|
```
|
||||||
|
|
||||||
|
The device id for the Bluetooth interface in this case is `0b05:17cb`.
|
||||||
@@ -54,10 +54,11 @@ console_scripts =
|
|||||||
bumble-scan = bumble.apps.scan:main
|
bumble-scan = bumble.apps.scan:main
|
||||||
bumble-show = bumble.apps.show:main
|
bumble-show = bumble.apps.show:main
|
||||||
bumble-unbond = bumble.apps.unbond:main
|
bumble-unbond = bumble.apps.unbond:main
|
||||||
|
bumble-usb-probe = bumble.apps.usb_probe:main
|
||||||
bumble-link-relay = bumble.apps.link_relay.link_relay:main
|
bumble-link-relay = bumble.apps.link_relay.link_relay:main
|
||||||
|
|
||||||
[options.extras_require]
|
[options.extras_require]
|
||||||
build =
|
build =
|
||||||
build >= 0.7
|
build >= 0.7
|
||||||
test =
|
test =
|
||||||
pytest >= 6.2
|
pytest >= 6.2
|
||||||
|
|||||||
Reference in New Issue
Block a user