Files
bumble_mirror/platforms/linux.html
2023-05-03 08:57:35 -07:00

1700 lines
47 KiB
HTML

<!doctype html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="icon" href="../images/favicon.ico">
<meta name="generator" content="mkdocs-1.3.1, mkdocs-material-8.4.0">
<title>Linux - Bumble</title>
<link rel="stylesheet" href="../assets/stylesheets/main.69437709.min.css">
<link rel="stylesheet" href="../assets/stylesheets/palette.cbb835fc.min.css">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback">
<style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style>
<link rel="stylesheet" href="../assets/_mkdocstrings.css">
<script>__md_scope=new URL("..",location),__md_hash=e=>[...e].reduce((e,_)=>(e<<5)-e+_.charCodeAt(0),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
</head>
<body dir="ltr" data-md-color-scheme="" data-md-color-primary="none" data-md-color-accent="none">
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" for="__drawer"></label>
<div data-md-component="skip">
<a href="#linux-platform" class="md-skip">
Skip to content
</a>
</div>
<div data-md-component="announce">
</div>
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
<a href="../index.html" title="Bumble" class="md-header__button md-logo" aria-label="Bumble" data-md-component="logo">
<img src="../images/logo.png" alt="logo">
</a>
<label class="md-header__button md-icon" for="__drawer">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2Z"/></svg>
</label>
<div class="md-header__title" data-md-component="header-title">
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
Bumble
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
<span class="md-ellipsis">
Linux
</span>
</div>
</div>
</div>
<div class="md-header__source">
<a href="https://github.com/google/bumble" title="Go to repository" class="md-source" data-md-component="source">
<div class="md-source__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 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="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg>
</div>
<div class="md-source__repository">
GitHub
</div>
</a>
</div>
</nav>
</header>
<div class="md-container" data-md-component="container">
<main class="md-main" data-md-component="main">
<div class="md-main__inner md-grid">
<div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
<a href="../index.html" title="Bumble" class="md-nav__button md-logo" aria-label="Bumble" data-md-component="logo">
<img src="../images/logo.png" alt="logo">
</a>
Bumble
</label>
<div class="md-nav__source">
<a href="https://github.com/google/bumble" title="Go to repository" class="md-source" data-md-component="source">
<div class="md-source__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 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="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg>
</div>
<div class="md-source__repository">
GitHub
</div>
</a>
</div>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../index.html" class="md-nav__link">
Introduction
</a>
</li>
<li class="md-nav__item">
<a href="../getting_started.html" class="md-nav__link">
Getting Started
</a>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_3" type="checkbox" id="__nav_3" >
<label class="md-nav__link" for="__nav_3">
Development
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" aria-label="Development" data-md-level="1">
<label class="md-nav__title" for="__nav_3">
<span class="md-nav__icon md-icon"></span>
Development
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../development/python_environments.html" class="md-nav__link">
Python Environments
</a>
</li>
<li class="md-nav__item">
<a href="../development/contributing.html" class="md-nav__link">
Contributing
</a>
</li>
<li class="md-nav__item">
<a href="../development/code_style.html" class="md-nav__link">
Code Style
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_4" type="checkbox" id="__nav_4" >
<label class="md-nav__link" for="__nav_4">
Use Cases
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" aria-label="Use Cases" data-md-level="1">
<label class="md-nav__title" for="__nav_4">
<span class="md-nav__icon md-icon"></span>
Use Cases
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../use_cases/index.html" class="md-nav__link">
Overview
</a>
</li>
<li class="md-nav__item">
<a href="../use_cases/use_case_1.html" class="md-nav__link">
Use Case 1
</a>
</li>
<li class="md-nav__item">
<a href="../use_cases/use_case_2.html" class="md-nav__link">
Use Case 2
</a>
</li>
<li class="md-nav__item">
<a href="../use_cases/use_case_3.html" class="md-nav__link">
Use Case 3
</a>
</li>
<li class="md-nav__item">
<a href="../use_cases/use_case_4.html" class="md-nav__link">
Use Case 4
</a>
</li>
<li class="md-nav__item">
<a href="../use_cases/use_case_5.html" class="md-nav__link">
Use Case 5
</a>
</li>
<li class="md-nav__item">
<a href="../use_cases/use_case_6.html" class="md-nav__link">
Use Case 6
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_5" type="checkbox" id="__nav_5" >
<label class="md-nav__link" for="__nav_5">
Components
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" aria-label="Components" data-md-level="1">
<label class="md-nav__title" for="__nav_5">
<span class="md-nav__icon md-icon"></span>
Components
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../components/controller.html" class="md-nav__link">
Controller
</a>
</li>
<li class="md-nav__item">
<a href="../components/host.html" class="md-nav__link">
Host
</a>
</li>
<li class="md-nav__item">
<a href="../components/gatt.html" class="md-nav__link">
GATT
</a>
</li>
<li class="md-nav__item">
<a href="../components/security_manager.html" class="md-nav__link">
Security Manager
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_6" type="checkbox" id="__nav_6" >
<label class="md-nav__link" for="__nav_6">
Transports
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" aria-label="Transports" data-md-level="1">
<label class="md-nav__title" for="__nav_6">
<span class="md-nav__icon md-icon"></span>
Transports
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../transports/index.html" class="md-nav__link">
Overview
</a>
</li>
<li class="md-nav__item">
<a href="../transports/serial.html" class="md-nav__link">
Serial
</a>
</li>
<li class="md-nav__item">
<a href="../transports/usb.html" class="md-nav__link">
USB
</a>
</li>
<li class="md-nav__item">
<a href="../transports/pty.html" class="md-nav__link">
PTY
</a>
</li>
<li class="md-nav__item">
<a href="../transports/udp.html" class="md-nav__link">
UDP
</a>
</li>
<li class="md-nav__item">
<a href="../transports/tcp_client.html" class="md-nav__link">
TCP Client
</a>
</li>
<li class="md-nav__item">
<a href="../transports/tcp_server.html" class="md-nav__link">
TCP Server
</a>
</li>
<li class="md-nav__item">
<a href="../transports/ws_client.html" class="md-nav__link">
WebSocket Client
</a>
</li>
<li class="md-nav__item">
<a href="../transports/ws_server.html" class="md-nav__link">
WebSocket Server
</a>
</li>
<li class="md-nav__item">
<a href="../transports/vhci.html" class="md-nav__link">
VHCI
</a>
</li>
<li class="md-nav__item">
<a href="../transports/hci_socket.html" class="md-nav__link">
HCI Socket
</a>
</li>
<li class="md-nav__item">
<a href="../transports/android_emulator.html" class="md-nav__link">
Android Emulator
</a>
</li>
<li class="md-nav__item">
<a href="../transports/file.html" class="md-nav__link">
File
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_7" type="checkbox" id="__nav_7" >
<label class="md-nav__link" for="__nav_7">
API
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" aria-label="API" data-md-level="1">
<label class="md-nav__title" for="__nav_7">
<span class="md-nav__icon md-icon"></span>
API
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../api/guide.html" class="md-nav__link">
Guide
</a>
</li>
<li class="md-nav__item">
<a href="../api/examples.html" class="md-nav__link">
Examples
</a>
</li>
<li class="md-nav__item">
<a href="../api/reference.html" class="md-nav__link">
Reference
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_8" type="checkbox" id="__nav_8" >
<label class="md-nav__link" for="__nav_8">
Apps & Tools
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" aria-label="Apps & Tools" data-md-level="1">
<label class="md-nav__title" for="__nav_8">
<span class="md-nav__icon md-icon"></span>
Apps & Tools
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../apps_and_tools/index.html" class="md-nav__link">
Overview
</a>
</li>
<li class="md-nav__item">
<a href="../apps_and_tools/console.html" class="md-nav__link">
Console
</a>
</li>
<li class="md-nav__item">
<a href="../apps_and_tools/bench.html" class="md-nav__link">
Bench
</a>
</li>
<li class="md-nav__item">
<a href="../apps_and_tools/hci_bridge.html" class="md-nav__link">
HCI Bridge
</a>
</li>
<li class="md-nav__item">
<a href="../apps_and_tools/gg_bridge.html" class="md-nav__link">
Golden Gate Bridge
</a>
</li>
<li class="md-nav__item">
<a href="../apps_and_tools/show.html" class="md-nav__link">
Show
</a>
</li>
<li class="md-nav__item">
<a href="../apps_and_tools/gatt_dump.html" class="md-nav__link">
GATT Dump
</a>
</li>
<li class="md-nav__item">
<a href="../apps_and_tools/pair.html" class="md-nav__link">
Pair
</a>
</li>
<li class="md-nav__item">
<a href="../apps_and_tools/unbond.html" class="md-nav__link">
Unbond
</a>
</li>
<li class="md-nav__item">
<a href="../apps_and_tools/usb_probe.html" class="md-nav__link">
USB Probe
</a>
</li>
<li class="md-nav__item">
<a href="../apps_and_tools/link_relay.html" class="md-nav__link">
Link Relay
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_9" type="checkbox" id="__nav_9" >
<label class="md-nav__link" for="__nav_9">
Hardware
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" aria-label="Hardware" data-md-level="1">
<label class="md-nav__title" for="__nav_9">
<span class="md-nav__icon md-icon"></span>
Hardware
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../hardware/index.html" class="md-nav__link">
Overview
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--active md-nav__item--nested">
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_10" type="checkbox" id="__nav_10" checked>
<label class="md-nav__link" for="__nav_10">
Platforms
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" aria-label="Platforms" data-md-level="1">
<label class="md-nav__title" for="__nav_10">
<span class="md-nav__icon md-icon"></span>
Platforms
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="index.html" class="md-nav__link">
Overview
</a>
</li>
<li class="md-nav__item">
<a href="macos.html" class="md-nav__link">
macOS
</a>
</li>
<li class="md-nav__item md-nav__item--active">
<input class="md-nav__toggle md-toggle" data-md-toggle="toc" type="checkbox" id="__toc">
<label class="md-nav__link md-nav__link--active" for="__toc">
Linux
<span class="md-nav__icon md-icon"></span>
</label>
<a href="linux.html" class="md-nav__link md-nav__link--active">
Linux
</a>
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
<label class="md-nav__title" for="__toc">
<span class="md-nav__icon md-icon"></span>
Table of contents
</label>
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
<li class="md-nav__item">
<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 Physical Bluetooth Controllers">
<ul class="md-nav__list">
<li class="md-nav__item">
<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>
<li class="md-nav__item">
<a href="#using-hci-sockets" class="md-nav__link">
Using HCI Sockets
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#bumble-on-the-raspberry-pi" class="md-nav__link">
Bumble on the Raspberry Pi
</a>
<nav class="md-nav" aria-label="Bumble on the Raspberry Pi">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#raspberry-pi-4" class="md-nav__link">
Raspberry Pi 4
</a>
<nav class="md-nav" aria-label="Raspberry Pi 4 ">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#via-the-kernel" class="md-nav__link">
Via The Kernel
</a>
</li>
<li class="md-nav__item">
<a href="#directly" class="md-nav__link">
Directly
</a>
</li>
</ul>
</nav>
</li>
</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>
</nav>
</li>
<li class="md-nav__item">
<a href="windows.html" class="md-nav__link">
Windows
</a>
</li>
<li class="md-nav__item">
<a href="android.html" class="md-nav__link">
Android
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_11" type="checkbox" id="__nav_11" >
<label class="md-nav__link" for="__nav_11">
Examples
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" aria-label="Examples" data-md-level="1">
<label class="md-nav__title" for="__nav_11">
<span class="md-nav__icon md-icon"></span>
Examples
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../examples/index.html" class="md-nav__link">
Overview
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
<label class="md-nav__title" for="__toc">
<span class="md-nav__icon md-icon"></span>
Table of contents
</label>
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
<li class="md-nav__item">
<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 Physical Bluetooth Controllers">
<ul class="md-nav__list">
<li class="md-nav__item">
<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>
<li class="md-nav__item">
<a href="#using-hci-sockets" class="md-nav__link">
Using HCI Sockets
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#bumble-on-the-raspberry-pi" class="md-nav__link">
Bumble on the Raspberry Pi
</a>
<nav class="md-nav" aria-label="Bumble on the Raspberry Pi">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#raspberry-pi-4" class="md-nav__link">
Raspberry Pi 4
</a>
<nav class="md-nav" aria-label="Raspberry Pi 4 ">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#via-the-kernel" class="md-nav__link">
Via The Kernel
</a>
</li>
<li class="md-nav__item">
<a href="#directly" class="md-nav__link">
Directly
</a>
</li>
</ul>
</nav>
</li>
</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>
</nav>
</div>
</div>
</div>
<div class="md-content" data-md-component="content">
<article class="md-content__inner md-typeset">
<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">&para;</a></h1>
<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">&para;</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">&para;</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">&para;</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">&para;</a></h3>
<p>HCI sockets provide a way to send/receive HCI packets to/from a Bluetooth controller managed by the kernel.
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&lt;X&gt;</code>, where <code>&lt;X&gt;</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&lt;X&gt; up</code> and <code>hciconfig hci&lt;X&gt; 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.
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=&quot;cap_net_admin+eip cap_setpcap,cap_setuid,cap_setgid+ep&quot; --keep=1 --user=$USER --addamb=cap_net_admin -- -c &quot;&lt;path/to/executable&gt; &lt;executable-args&gt;&quot;
</code></pre></div>
Where <code>&lt;path/to/executable&gt;</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
<div class="highlight"><pre><span></span><code>$ hciconfig
</code></pre></div>
lists all available HCI controllers and their state.</p>
<p>Example:</p>
<div class="highlight"><pre><span></span><code>pi@raspberrypi:~ $ hciconfig
hci1: Type: Primary Bus: USB
BD Address: 00:16:A4:5A:40:F2 ACL MTU: 1021:8 SCO MTU: 64:1
DOWN
RX bytes:84056 acl:0 sco:0 events:51 errors:0
TX bytes:1980 acl:0 sco:0 commands:90 errors:0
hci0: Type: Primary Bus: UART
BD Address: DC:A6:32:75:2C:97 ACL MTU: 1021:8 SCO MTU: 64:1
DOWN
RX bytes:68038 acl:0 sco:0 events:692 errors:0
TX bytes:20105 acl:0 sco:0 commands:843 errors:0
</code></pre></div>
</div>
<div class="admonition tip">
<p class="admonition-title">Disabling <code>bluetoothd</code></p>
<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>hci&lt;X&gt;</code> with <code>&lt;X&gt;</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
```
$ sudo systemctl start bluetooth.service</p>
</div>
<h2 id="bumble-on-the-raspberry-pi">Bumble on the Raspberry Pi<a class="headerlink" href="#bumble-on-the-raspberry-pi" title="Permanent link">&para;</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">&para;</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">&para;</a></h4>
<p>Use an HCI Socket transport (see section above)</p>
<h4 id="directly">Directly<a class="headerlink" href="#directly" title="Permanent link">&para;</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
</code></pre></div>
should detach the controller from the stack, after which you can use the HCI UART with Bumble.</p>
<div class="admonition tip">
<p class="admonition-title">Check the device name for the UART and at what speed it should be opened</p>
<p><div class="highlight"><pre><span></span><code>$ sudo systemctl status hciuart
</code></pre></div>
should show the speed at which the UART should be opened.
For example:
<div class="highlight"><pre><span></span><code>$ sudo systemctl status hciuart
hciuart.service - Configure Bluetooth Modems connected by UART
Loaded: loaded (/lib/systemd/system/hciuart.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2021-06-18 02:17:28 BST; 1min 10s ago
Process: 357 ExecStart=/usr/bin/btuart (code=exited, status=0/SUCCESS)
Main PID: 586 (hciattach)
Tasks: 1 (limit: 4915)
CGroup: /system.slice/hciuart.service
└─586 /usr/bin/hciattach /dev/serial1 bcm43xx 3000000 flow -
</code></pre></div>
When run before stopping the <code>hciuart</code> service, shows that on this board, the UART device is <code>/dev/serial</code> and the speed is <code>3000000</code></p>
</div>
<div class="admonition example">
<p class="admonition-title">Example: scanning</p>
<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">&para;</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">&para;</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">&para;</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">&para;</a></h3>
</article>
</div>
</div>
</main>
<footer class="md-footer">
<div class="md-footer-nav">
<nav class="md-footer-nav__inner md-grid">
<a href="macos.html" title="macOS" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev">
<div class="md-flex__cell md-flex__cell--shrink">
<i class="md-icon md-icon--arrow-back md-footer-nav__button"></i>
</div>
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
<span class="md-flex__ellipsis">
<span class="md-footer-nav__direction">
Previous
</span>
macOS
</span>
</div>
</a>
<a href="windows.html" title="Windows" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next">
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
<span class="md-flex__ellipsis">
<span class="md-footer-nav__direction">
Next
</span>
Windows
</span>
</div>
<div class="md-flex__cell md-flex__cell--shrink">
<i class="md-icon md-icon--arrow-forward md-footer-nav__button"></i>
</div>
</a>
</nav>
</div>
<div class="md-footer-meta md-typeset">
<div class="md-footer-meta__inner md-grid">
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
Copyright 2021-2023 Google LLC
</div>
</div>
<div class="md-social">
</div>
</div>
</div>
</footer>
</div>
<div class="md-dialog" data-md-component="dialog">
<div class="md-dialog__inner md-typeset"></div>
</div>
<script id="__config" type="application/json">{"base": "..", "features": [], "search": "../assets/javascripts/workers/search.ecf98df9.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.config.lang": "en", "search.config.pipeline": "trimmer, stopWordFilter", "search.config.separator": "[\\s\\-]+", "search.placeholder": "Search", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version.title": "Select version"}}</script>
<script src="../assets/javascripts/bundle.9c69f0bc.min.js"></script>
</body>
</html>