mirror of
https://github.com/google/bumble.git
synced 2026-04-18 00:45:32 +00:00
Deployed 68d9fbc with MkDocs version: 1.3.1
This commit is contained in:
@@ -1074,16 +1074,23 @@
|
||||
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#using-bumble-with-bluez" class="md-nav__link">
|
||||
Using Bumble With BlueZ
|
||||
<a href="#using-bumble-with-physical-bluetooth-controllers" class="md-nav__link">
|
||||
Using Bumble With Physical Bluetooth Controllers
|
||||
</a>
|
||||
|
||||
<nav class="md-nav" aria-label="Using Bumble With BlueZ">
|
||||
<nav class="md-nav" aria-label="Using Bumble With Physical Bluetooth Controllers">
|
||||
<ul class="md-nav__list">
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#using-vhci" class="md-nav__link">
|
||||
Using VHCI
|
||||
<a href="#using-a-usb-dongle" class="md-nav__link">
|
||||
Using a USB Dongle
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#using-hci-over-uart" class="md-nav__link">
|
||||
Using HCI over UART
|
||||
</a>
|
||||
|
||||
</li>
|
||||
@@ -1093,20 +1100,6 @@
|
||||
Using HCI Sockets
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#using-a-simulated-uart-hci" class="md-nav__link">
|
||||
Using a Simulated UART HCI
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#bridge-to-a-remote-controller" class="md-nav__link">
|
||||
Bridge to a Remote Controller
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
@@ -1115,11 +1108,11 @@
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#using-bumble-with-bluetooth-controllers" class="md-nav__link">
|
||||
Using Bumble With Bluetooth Controllers
|
||||
<a href="#bumble-on-the-raspberry-pi" class="md-nav__link">
|
||||
Bumble on the Raspberry Pi
|
||||
</a>
|
||||
|
||||
<nav class="md-nav" aria-label="Using Bumble With Bluetooth Controllers">
|
||||
<nav class="md-nav" aria-label="Bumble on the Raspberry Pi">
|
||||
<ul class="md-nav__list">
|
||||
|
||||
<li class="md-nav__item">
|
||||
@@ -1152,6 +1145,40 @@
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#using-bumble-with-bluez" class="md-nav__link">
|
||||
Using Bumble With BlueZ
|
||||
</a>
|
||||
|
||||
<nav class="md-nav" aria-label="Using Bumble With BlueZ">
|
||||
<ul class="md-nav__list">
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#using-vhci" class="md-nav__link">
|
||||
Using VHCI
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#using-a-simulated-uart-hci" class="md-nav__link">
|
||||
Using a Simulated UART HCI
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#bridge-to-a-remote-controller" class="md-nav__link">
|
||||
Bridge to a Remote Controller
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
@@ -1272,16 +1299,23 @@
|
||||
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#using-bumble-with-bluez" class="md-nav__link">
|
||||
Using Bumble With BlueZ
|
||||
<a href="#using-bumble-with-physical-bluetooth-controllers" class="md-nav__link">
|
||||
Using Bumble With Physical Bluetooth Controllers
|
||||
</a>
|
||||
|
||||
<nav class="md-nav" aria-label="Using Bumble With BlueZ">
|
||||
<nav class="md-nav" aria-label="Using Bumble With Physical Bluetooth Controllers">
|
||||
<ul class="md-nav__list">
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#using-vhci" class="md-nav__link">
|
||||
Using VHCI
|
||||
<a href="#using-a-usb-dongle" class="md-nav__link">
|
||||
Using a USB Dongle
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#using-hci-over-uart" class="md-nav__link">
|
||||
Using HCI over UART
|
||||
</a>
|
||||
|
||||
</li>
|
||||
@@ -1291,20 +1325,6 @@
|
||||
Using HCI Sockets
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#using-a-simulated-uart-hci" class="md-nav__link">
|
||||
Using a Simulated UART HCI
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#bridge-to-a-remote-controller" class="md-nav__link">
|
||||
Bridge to a Remote Controller
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
@@ -1313,11 +1333,11 @@
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#using-bumble-with-bluetooth-controllers" class="md-nav__link">
|
||||
Using Bumble With Bluetooth Controllers
|
||||
<a href="#bumble-on-the-raspberry-pi" class="md-nav__link">
|
||||
Bumble on the Raspberry Pi
|
||||
</a>
|
||||
|
||||
<nav class="md-nav" aria-label="Using Bumble With Bluetooth Controllers">
|
||||
<nav class="md-nav" aria-label="Bumble on the Raspberry Pi">
|
||||
<ul class="md-nav__list">
|
||||
|
||||
<li class="md-nav__item">
|
||||
@@ -1350,6 +1370,40 @@
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#using-bumble-with-bluez" class="md-nav__link">
|
||||
Using Bumble With BlueZ
|
||||
</a>
|
||||
|
||||
<nav class="md-nav" aria-label="Using Bumble With BlueZ">
|
||||
<ul class="md-nav__list">
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#using-vhci" class="md-nav__link">
|
||||
Using VHCI
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#using-a-simulated-uart-hci" class="md-nav__link">
|
||||
Using a Simulated UART HCI
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#bridge-to-a-remote-controller" class="md-nav__link">
|
||||
Bridge to a Remote Controller
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
@@ -1367,36 +1421,67 @@
|
||||
|
||||
|
||||
<h1 id="linux-platform"><span class="twemoji"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14.62 8.35c-.42.28-1.75 1.04-1.95 1.19-.39.31-.75.29-1.14-.01-.2-.16-1.53-.92-1.95-1.19-.48-.31-.45-.7.08-.92 1.64-.69 3.28-.64 4.91.03.49.21.51.6.05.9m7.22 7.28c-.93-2.09-2.2-3.99-3.84-5.66a4.31 4.31 0 0 1-1.06-1.88c-.1-.33-.17-.67-.24-1.01-.2-.88-.29-1.78-.7-2.61-.73-1.58-2-2.4-3.84-2.47-1.81.05-3.16.81-3.95 2.4-.21.43-.36.88-.46 1.34-.17.76-.32 1.55-.5 2.32-.15.65-.45 1.21-.96 1.71-1.61 1.57-2.9 3.37-3.88 5.35-.14.29-.28.58-.37.88-.19.66.29 1.12.99.96.44-.09.88-.18 1.3-.31.41-.15.57-.05.67.35.65 2.15 2.07 3.66 4.24 4.5 4.12 1.56 8.93-.66 9.97-4.58.07-.27.17-.37.47-.27.46.14.93.24 1.4.35.49.09.85-.16.92-.64.03-.26-.06-.49-.16-.73"/></svg></span> LINUX PLATFORM<a class="headerlink" href="#linux-platform" title="Permanent link">¶</a></h1>
|
||||
<p>In addition to all the standard functionality available from the project by running the python tools and/or writing your own apps by leveraging the API, it is also possible on Linux hosts to interface the Bumble stack with the native BlueZ stack, and with Bluetooth controllers.</p>
|
||||
<h2 id="using-bumble-with-bluez">Using Bumble With BlueZ<a class="headerlink" href="#using-bumble-with-bluez" title="Permanent link">¶</a></h2>
|
||||
<p>A Bumble virtual controller can be attached to the BlueZ stack.
|
||||
Attaching a controller to BlueZ can be done by either simulating a UART HCI interface, or by using the VHCI driver interface if available.
|
||||
In both cases, the controller can run locally on the Linux host, or remotely on a different host, with a bridge between the remote controller and the local BlueZ host, which may be useful when the BlueZ stack is running on an embedded system, or a host on which running the Bumble controller is not convenient.</p>
|
||||
<h3 id="using-vhci">Using VHCI<a class="headerlink" href="#using-vhci" title="Permanent link">¶</a></h3>
|
||||
<p>With the <a href="../transports/vhci.html">VHCI transport</a> you can attach a Bumble virtual controller to the BlueZ stack. Once attached, the controller will appear just like any other controller, and thus can be used with the standard BlueZ tools.</p>
|
||||
<div class="admonition example">
|
||||
<p class="admonition-title">Attaching a virtual controller</p>
|
||||
<p>With the example app <code>run_controller.py</code>:
|
||||
<div class="highlight"><pre><span></span><code>PYTHONPATH=. python3 examples/run_controller.py F6:F7:F8:F9:FA:FB examples/device1.json vhci
|
||||
</code></pre></div></p>
|
||||
<p>You should see a 'Virtual Bus' controller. For example:
|
||||
<div class="highlight"><pre><span></span><code>$ hciconfig
|
||||
hci0: Type: Primary Bus: Virtual
|
||||
BD Address: F6:F7:F8:F9:FA:FB ACL MTU: 27:64 SCO MTU: 0:0
|
||||
UP RUNNING
|
||||
RX bytes:0 acl:0 sco:0 events:43 errors:0
|
||||
TX bytes:274 acl:0 sco:0 commands:43 errors:0
|
||||
</code></pre></div></p>
|
||||
<p>And scanning for devices should show the virtual 'Bumble' device that's running as part of the <code>run_controller.py</code> example app:
|
||||
<div class="highlight"><pre><span></span><code>pi@raspberrypi:~ $ sudo hcitool -i hci2 lescan
|
||||
LE Scan ...
|
||||
F0:F1:F2:F3:F4:F5 Bumble
|
||||
<h2 id="using-bumble-with-physical-bluetooth-controllers">Using Bumble With Physical Bluetooth Controllers<a class="headerlink" href="#using-bumble-with-physical-bluetooth-controllers" title="Permanent link">¶</a></h2>
|
||||
<p>A Bumble application can interface with a local Bluetooth controller on a Linux host.
|
||||
The 3 main types of physical Bluetooth controllers are:</p>
|
||||
<ul>
|
||||
<li>Bluetooth USB Dongle</li>
|
||||
<li>HCI over UART (via a serial port)</li>
|
||||
<li>Kernel-managed Bluetooth HCI (HCI Sockets)</li>
|
||||
</ul>
|
||||
<div class="admonition tip">
|
||||
<p class="admonition-title">Conflicts with the kernel and BlueZ</p>
|
||||
<p>If your use a USB dongle that is recognized by your kernel as a supported Bluetooth device, it is
|
||||
likely that the kernel driver will claim that USB device and attach it to the BlueZ stack.
|
||||
If you want to claim ownership of it to use with Bumble, you will need to set the state of the corresponding HCI interface as <code>DOWN</code>.
|
||||
HCI interfaces are numbered, starting from 0 (i.e <code>hci0</code>, <code>hci1</code>, ...).</p>
|
||||
<p>For example, to bring <code>hci0</code> down:
|
||||
<div class="highlight"><pre><span></span><code>$ sudo hciconfig hci0 down
|
||||
</code></pre></div></p>
|
||||
<p>You can use the <code>hciconfig</code> command with no arguments to get a list of HCI interfaces seen by
|
||||
the kernel.</p>
|
||||
<p>Also, if <code>bluetoothd</code> is running on your system, it will likely re-claim the interface after you
|
||||
close it, so you may need to bring the interface back <code>UP</code> before using it again, or to disable
|
||||
<code>bluetoothd</code> altogether (see the section further below about BlueZ and <code>bluetoothd</code>).</p>
|
||||
</div>
|
||||
<h3 id="using-a-usb-dongle">Using a USB Dongle<a class="headerlink" href="#using-a-usb-dongle" title="Permanent link">¶</a></h3>
|
||||
<p>See the <a href="../transports/usb.html">USB Transport page</a> for general information on how to use HCI USB controllers.</p>
|
||||
<div class="admonition tip">
|
||||
<p class="admonition-title">USB Permissions</p>
|
||||
<p>By default, when running as a regular user, you won't have the permission to use
|
||||
arbitrary USB devices.
|
||||
You can change the permissions for a specific USB device based on its bus number and
|
||||
device number (you can use <code>lsusb</code> to find the Bus and Device numbers for your Bluetooth
|
||||
dongle).</p>
|
||||
<p>Example:
|
||||
<div class="highlight"><pre><span></span><code>$ sudo chmod o+w /dev/bus/usb/001/004
|
||||
</code></pre></div>
|
||||
This will change the permissions for Device 4 on Bus 1.</p>
|
||||
<p>Note that the USB Bus number and Device number may change depending on where you plug the USB
|
||||
dongle and what other USB devices and hubs are also plugged in.</p>
|
||||
<p>If you need to make the permission changes permanent across reboots, you can create a <code>udev</code>
|
||||
rule for your specific Bluetooth dongle. Visit <a href="https://wiki.archlinux.org/title/udev">this Arch Linux Wiki page</a> for a
|
||||
good overview of how you may do that.</p>
|
||||
</div>
|
||||
<h3 id="using-hci-over-uart">Using HCI over UART<a class="headerlink" href="#using-hci-over-uart" title="Permanent link">¶</a></h3>
|
||||
<p>See the <a href="../transports/serial.html">Serial Transport page</a> for general information on how to use HCI over a UART (serial port).</p>
|
||||
<h3 id="using-hci-sockets">Using HCI Sockets<a class="headerlink" href="#using-hci-sockets" title="Permanent link">¶</a></h3>
|
||||
<p>HCI sockets provide a way to send/receive HCI packets to/from a Bluetooth controller managed by the kernel.
|
||||
The HCI device referenced by an <code>hci-socket</code> transport (<code>hciX</code>, where <code>X</code> is an integer, with <code>hci0</code> being the first controller device, and so on) must be in the <code>DOWN</code> state before it can be opened as a transport.
|
||||
You can bring a HCI controller <code>UP</code> or <code>DOWN</code> with <code>hciconfig</code>.</p>
|
||||
See the <a href="../transports/hci_socket.html">HCI Socket Transport page</a> for details on the <code>hci-socket</code> tansport syntax.</p>
|
||||
<p>The HCI device referenced by an <code>hci-socket</code> transport (<code>hci<X></code>, where <code><X></code> is an integer, with <code>hci0</code> being the first controller device, and so on) must be in the <code>DOWN</code> state before it can be opened as a transport.
|
||||
You can bring a HCI controller <code>UP</code> or <code>DOWN</code> with <code>hciconfig hci<X> up</code> and <code>hciconfig hci<X> up</code>.</p>
|
||||
<div class="admonition tip">
|
||||
<p class="admonition-title">HCI Socket Permissions</p>
|
||||
<p>By default, when running as a regular user, you won't have the permission to use
|
||||
an HCI socket to a Bluetooth controller (you may see an exception like <code>PermissionError: [Errno 1] Operation not permitted</code>).</p>
|
||||
<p>If you want to run without using <code>sudo</code>, you need to manage the capabilities by adding the appropriate entries in <code>/etc/security/capability.conf</code> to grant a user or group the <code>cap_net_admin</code> capability.<br />
|
||||
See <a href="https://manpages.ubuntu.com/manpages/bionic/man5/capability.conf.5.html">this manpage</a> for details.</p>
|
||||
<p>Alternatively, if you are just experimenting temporarily, the <code>capsh</code> command may be useful in order
|
||||
to execute a single command with enhanced permissions, as in this example:</p>
|
||||
<p><div class="highlight"><pre><span></span><code>$ sudo capsh --caps="cap_net_admin+eip cap_setpcap,cap_setuid,cap_setgid+ep" --keep=1 --user=$USER --addamb=cap_net_admin -- -c "<path/to/executable> <executable-args>"
|
||||
</code></pre></div>
|
||||
Where <code><path/to/executable></code> is the path to your <code>python3</code> executable or to one of the Bumble bundled command-line applications.</p>
|
||||
</div>
|
||||
<div class="admonition tip">
|
||||
<p class="admonition-title">List all available controllers</p>
|
||||
<p>The command
|
||||
@@ -1423,25 +1508,18 @@ hci0: Type: Primary Bus: UART
|
||||
<p>When the Bluetooth daemon, <code>bluetoothd</code>, is running, it will try to use any HCI controller attached to the BlueZ stack, automatically. This means that whenever an HCI socket transport is released, it is likely that <code>bluetoothd</code> will take it over, so you will get a "device busy" condition (ex: <code>OSError: [Errno 16] Device or resource busy</code>). If that happens, you can always use
|
||||
<div class="highlight"><pre><span></span><code>$ hciconfig hci0 down
|
||||
</code></pre></div>
|
||||
(or <code>hciX</code> with <code>X</code> being the index of the controller device you want to use), but a simpler solution is to just stop the <code>bluetoothd</code> daemon, with a command like:
|
||||
(or <code>hci<X></code> with <code><X></code> being the index of the controller device you want to use), but a simpler solution is to just stop the <code>bluetoothd</code> daemon, with a command like:
|
||||
<div class="highlight"><pre><span></span><code>$ sudo systemctl stop bluetooth.service
|
||||
</code></pre></div>
|
||||
You can always re-start the daemon with
|
||||
<div class="highlight"><pre><span></span><code>$ sudo systemctl start bluetooth.service
|
||||
</code></pre></div></p>
|
||||
```
|
||||
$ sudo systemctl start bluetooth.service</p>
|
||||
</div>
|
||||
<h3 id="using-a-simulated-uart-hci">Using a Simulated UART HCI<a class="headerlink" href="#using-a-simulated-uart-hci" title="Permanent link">¶</a></h3>
|
||||
<h3 id="bridge-to-a-remote-controller">Bridge to a Remote Controller<a class="headerlink" href="#bridge-to-a-remote-controller" title="Permanent link">¶</a></h3>
|
||||
<h2 id="using-bumble-with-bluetooth-controllers">Using Bumble With Bluetooth Controllers<a class="headerlink" href="#using-bumble-with-bluetooth-controllers" title="Permanent link">¶</a></h2>
|
||||
<p>A Bumble application can interface with a local Bluetooth controller.
|
||||
If your Bluetooth controller is a standard HCI USB controller, see the <a href="../transports/usb.html">USB Transport page</a> for details on how to use HCI USB controllers.
|
||||
If your Bluetooth controller is a standard HCI UART controller, see the <a href="../transports/serial.html">Serial Transport page</a>.
|
||||
Alternatively, a Bumble Host object can communicate with one of the platform's controllers via an HCI Socket.</p>
|
||||
<p><code><details to be filled in></code></p>
|
||||
<h2 id="bumble-on-the-raspberry-pi">Bumble on the Raspberry Pi<a class="headerlink" href="#bumble-on-the-raspberry-pi" title="Permanent link">¶</a></h2>
|
||||
<h3 id="raspberry-pi-4">Raspberry Pi 4 <span class="twemoji"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 407 512"><!--! Font Awesome Free 6.1.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="m372 232.5-3.7-6.5c.1-46.4-21.4-65.3-46.5-79.7 7.6-2 15.4-3.6 17.6-13.2 13.1-3.3 15.8-9.4 17.1-15.8 3.4-2.3 14.8-8.7 13.6-19.7 6.4-4.4 10-10.1 8.1-18.1 6.9-7.5 8.7-13.7 5.8-19.4 8.3-10.3 4.6-15.6 1.1-20.9 6.2-11.2.7-23.2-16.6-21.2-6.9-10.1-21.9-7.8-24.2-7.8-2.6-3.2-6-6-16.5-4.7-6.8-6.1-14.4-5-22.3-2.1-9.3-7.3-15.5-1.4-22.6.8C271.6.6 269 5.5 263.5 7.6c-12.3-2.6-16.1 3-22 8.9l-6.9-.1c-18.6 10.8-27.8 32.8-31.1 44.1-3.3-11.3-12.5-33.3-31.1-44.1l-6.9.1c-5.9-5.9-9.7-11.5-22-8.9-5.6-2-8.1-7-19.4-3.4-4.6-1.4-8.9-4.4-13.9-4.3-2.6.1-5.5 1-8.7 3.5-7.9-3-15.5-4-22.3 2.1-10.5-1.3-14 1.4-16.5 4.7-2.3 0-17.3-2.3-24.2 7.8C21.2 16 15.8 28 22 39.2c-3.5 5.4-7.2 10.7 1.1 20.9-2.9 5.7-1.1 11.9 5.8 19.4-1.8 8 1.8 13.7 8.1 18.1-1.2 11 10.2 17.4 13.6 19.7 1.3 6.4 4 12.4 17.1 15.8 2.2 9.5 10 11.2 17.6 13.2-25.1 14.4-46.6 33.3-46.5 79.7l-3.7 6.5c-28.8 17.2-54.7 72.7-14.2 117.7 2.6 14.1 7.1 24.2 11 35.4 5.9 45.2 44.5 66.3 54.6 68.8 14.9 11.2 30.8 21.8 52.2 29.2C159 504.2 181 512 203 512h1c22.1 0 44-7.8 64.2-28.4 21.5-7.4 37.3-18 52.2-29.2 10.2-2.5 48.7-23.6 54.6-68.8 3.9-11.2 8.4-21.3 11-35.4 40.6-45.1 14.7-100.5-14-117.7zm-22.2-8c-1.5 18.7-98.9-65.1-82.1-67.9 45.7-7.5 83.6 19.2 82.1 67.9zm-43 93.1c-24.5 15.8-59.8 5.6-78.8-22.8s-14.6-64.2 9.9-80c24.5-15.8 59.8-5.6 78.8 22.8s14.6 64.2-9.9 80zM238.9 29.3c.8 4.2 1.8 6.8 2.9 7.6 5.4-5.8 9.8-11.7 16.8-17.3 0 3.3-1.7 6.8 2.5 9.4 3.7-5 8.8-9.5 15.5-13.3-3.2 5.6-.6 7.3 1.2 9.6 5.1-4.4 10-8.8 19.4-12.3-2.6 3.1-6.2 6.2-2.4 9.8 5.3-3.3 10.6-6.6 23.1-8.9-2.8 3.1-8.7 6.3-5.1 9.4 6.6-2.5 14-4.4 22.1-5.4-3.9 3.2-7.1 6.3-3.9 8.8 7.1-2.2 16.9-5.1 26.4-2.6l-6 6.1c-.7.8 14.1.6 23.9.8-3.6 5-7.2 9.7-9.3 18.2 1 1 5.8.4 10.4 0-4.7 9.9-12.8 12.3-14.7 16.6 2.9 2.2 6.8 1.6 11.2.1-3.4 6.9-10.4 11.7-16 17.3 1.4 1 3.9 1.6 9.7.9-5.2 5.5-11.4 10.5-18.8 15 1.3 1.5 5.8 1.5 10 1.6-6.7 6.5-15.3 9.9-23.4 14.2 4 2.7 6.9 2.1 10 2.1-5.7 4.7-15.4 7.1-24.4 10 1.7 2.7 3.4 3.4 7.1 4.1-9.5 5.3-23.2 2.9-27 5.6.9 2.7 3.6 4.4 6.7 5.8-15.4.9-57.3-.6-65.4-32.3 15.7-17.3 44.4-37.5 93.7-62.6-38.4 12.8-73 30-102 53.5-34.3-15.9-10.8-55.9 5.8-71.8zm-34.4 114.6c24.2-.3 54.1 17.8 54 34.7-.1 15-21 27.1-53.8 26.9-32.1-.4-53.7-15.2-53.6-29.8 0-11.9 26.2-32.5 53.4-31.8zm-123-12.8c3.7-.7 5.4-1.5 7.1-4.1-9-2.8-18.7-5.3-24.4-10 3.1 0 6 .7 10-2.1-8.1-4.3-16.7-7.7-23.4-14.2 4.2-.1 8.7 0 10-1.6-7.4-4.5-13.6-9.5-18.8-15 5.8.7 8.3.1 9.7-.9-5.6-5.6-12.7-10.4-16-17.3 4.3 1.5 8.3 2 11.2-.1-1.9-4.2-10-6.7-14.7-16.6 4.6.4 9.4 1 10.4 0-2.1-8.5-5.8-13.3-9.3-18.2 9.8-.1 24.6 0 23.9-.8l-6-6.1c9.5-2.5 19.3.4 26.4 2.6 3.2-2.5-.1-5.6-3.9-8.8 8.1 1.1 15.4 2.9 22.1 5.4 3.5-3.1-2.3-6.3-5.1-9.4 12.5 2.3 17.8 5.6 23.1 8.9 3.8-3.6.2-6.7-2.4-9.8 9.4 3.4 14.3 7.9 19.4 12.3 1.7-2.3 4.4-4 1.2-9.6 6.7 3.8 11.8 8.3 15.5 13.3 4.1-2.6 2.5-6.2 2.5-9.4 7 5.6 11.4 11.5 16.8 17.3 1.1-.8 2-3.4 2.9-7.6 16.6 15.9 40.1 55.9 6 71.8-29-23.5-63.6-40.7-102-53.5 49.3 25 78 45.3 93.7 62.6-8 31.8-50 33.2-65.4 32.3 3.1-1.4 5.8-3.2 6.7-5.8-4-2.8-17.6-.4-27.2-5.6zm60.1 24.1c16.8 2.8-80.6 86.5-82.1 67.9-1.5-48.7 36.5-75.5 82.1-67.9zM38.2 342c-23.7-18.8-31.3-73.7 12.6-98.3 26.5-7 9 107.8-12.6 98.3zm91 98.2c-13.3 7.9-45.8 4.7-68.8-27.9-15.5-27.4-13.5-55.2-2.6-63.4 16.3-9.8 41.5 3.4 60.9 25.6 16.9 20 24.6 55.3 10.5 65.7zm-26.4-119.7c-24.5-15.8-28.9-51.6-9.9-80s54.3-38.6 78.8-22.8 28.9 51.6 9.9 80c-19.1 28.4-54.4 38.6-78.8 22.8zM205 496c-29.4 1.2-58.2-23.7-57.8-32.3-.4-12.7 35.8-22.6 59.3-22 23.7-1 55.6 7.5 55.7 18.9.5 11-28.8 35.9-57.2 35.4zm58.9-124.9c.2 29.7-26.2 53.8-58.8 54-32.6.2-59.2-23.8-59.4-53.4v-.6c-.2-29.7 26.2-53.8 58.8-54 32.6-.2 59.2 23.8 59.4 53.4v.6zm82.2 42.7c-25.3 34.6-59.6 35.9-72.3 26.3-13.3-12.4-3.2-50.9 15.1-72 20.9-23.3 43.3-38.5 58.9-26.6 10.5 10.3 16.7 49.1-1.7 72.3zm22.9-73.2c-21.5 9.4-39-105.3-12.6-98.3 43.9 24.7 36.3 79.6 12.6 98.3z"/></svg></span><a class="headerlink" href="#raspberry-pi-4" title="Permanent link">¶</a></h3>
|
||||
<p>You can use the Bluetooth controller either via the kernel, or directly to the device.</p>
|
||||
<h4 id="via-the-kernel">Via The Kernel<a class="headerlink" href="#via-the-kernel" title="Permanent link">¶</a></h4>
|
||||
<p>Use an HCI Socket transport</p>
|
||||
<p>Use an HCI Socket transport (see section above)</p>
|
||||
<h4 id="directly">Directly<a class="headerlink" href="#directly" title="Permanent link">¶</a></h4>
|
||||
<p>In order to use the Bluetooth controller directly on a Raspberry Pi 4 board, you need to ensure that it isn't being used by the BlueZ stack (which it probably is by default).</p>
|
||||
<p><div class="highlight"><pre><span></span><code>$ sudo systemctl stop hciuart
|
||||
@@ -1470,6 +1548,35 @@ When run before stopping the <code>hciuart</code> service, shows that on this bo
|
||||
<div class="highlight"><pre><span></span><code>python3 run_scanner.py serial:/dev/serial1,3000000
|
||||
</code></pre></div>
|
||||
</div>
|
||||
<h2 id="using-bumble-with-bluez">Using Bumble With BlueZ<a class="headerlink" href="#using-bumble-with-bluez" title="Permanent link">¶</a></h2>
|
||||
<p>In addition to all the standard functionality available from the project by running the python tools and/or writing your own apps by leveraging the API, it is also possible on Linux hosts to interface the Bumble stack with the native BlueZ stack, and with Bluetooth controllers.</p>
|
||||
<p>A Bumble virtual controller can be attached to the BlueZ stack.
|
||||
Attaching a controller to BlueZ can be done by either simulating a UART HCI interface, or by using the VHCI driver interface if available.
|
||||
In both cases, the controller can run locally on the Linux host, or remotely on a different host, with a bridge between the remote controller and the local BlueZ host, which may be useful when the BlueZ stack is running on an embedded system, or a host on which running the Bumble controller is not convenient.</p>
|
||||
<h3 id="using-vhci">Using VHCI<a class="headerlink" href="#using-vhci" title="Permanent link">¶</a></h3>
|
||||
<p>With the <a href="../transports/vhci.html">VHCI transport</a> you can attach a Bumble virtual controller to the BlueZ stack. Once attached, the controller will appear just like any other controller, and thus can be used with the standard BlueZ tools.</p>
|
||||
<div class="admonition example">
|
||||
<p class="admonition-title">Attaching a virtual controller</p>
|
||||
<p>With the example app <code>run_controller.py</code>:
|
||||
<div class="highlight"><pre><span></span><code>python3 examples/run_controller.py F6:F7:F8:F9:FA:FB examples/device1.json vhci
|
||||
</code></pre></div></p>
|
||||
<p>You should see a 'Virtual Bus' controller. For example:
|
||||
<div class="highlight"><pre><span></span><code>$ hciconfig
|
||||
hci0: Type: Primary Bus: Virtual
|
||||
BD Address: F6:F7:F8:F9:FA:FB ACL MTU: 27:64 SCO MTU: 0:0
|
||||
UP RUNNING
|
||||
RX bytes:0 acl:0 sco:0 events:43 errors:0
|
||||
TX bytes:274 acl:0 sco:0 commands:43 errors:0
|
||||
</code></pre></div></p>
|
||||
<p>And scanning for devices should show the virtual 'Bumble' device that's running as part of the <code>run_controller.py</code> example app:
|
||||
<div class="highlight"><pre><span></span><code>pi@raspberrypi:~ $ sudo hcitool -i hci2 lescan
|
||||
LE Scan ...
|
||||
F0:F1:F2:F3:F4:F5 Bumble
|
||||
</code></pre></div></p>
|
||||
<p>```</p>
|
||||
</div>
|
||||
<h3 id="using-a-simulated-uart-hci">Using a Simulated UART HCI<a class="headerlink" href="#using-a-simulated-uart-hci" title="Permanent link">¶</a></h3>
|
||||
<h3 id="bridge-to-a-remote-controller">Bridge to a Remote Controller<a class="headerlink" href="#bridge-to-a-remote-controller" title="Permanent link">¶</a></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user