Introduction to BlueZ
The BlueZ package contains the
Bluetooth protocol stack for Linux.
This package is known to build and work properly
using an LFS 12.4 platform.
Package Information
Download (HTTP): https://www.kernel.org/pub//linux/bluetooth/bluez-5.84.tar.xz
Download SHA256 Sum: 5ba73d030f7b00087d67800b0e321601aec0f892827c72e5a2c8390d8c886b11
Download MD5 sum: 85a0f15668a6d77f09e399eca0645a70
Download size: 16,701.9 KB
Estimated disk space required: 168,944.4 KB
Estimated build time: 2.07 SBU
BlueZ Dependencies
Required
dbus-1.16.2,
GLib-2.86.2, and
libical-3.0.20
Recommended
docutils-0.22.3 (to generate man pages)
Kernel Configuration
If you are building this package to use bluetooth devices (rather than as a
build dependency), enable the following options in the kernel configuration,
also the options in the “Cryptographic API” section if
you intend to run the tests, and recompile the kernel if necessary:
Installation of BlueZ
Prepare BlueZ by running the following
commands:
./configure --prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var \
--enable-librarymake
To test the results, issue:
make check
Now, as the root user:
make install
ln -svf ../libexec/bluetooth/bluetoothd /usr/sbin
Install the main configuration file as the root user:
install -v -dm755 /etc/bluetooth
install -v -m644 src/main.conf /etc/bluetooth/main.conf
If desired, install the API documentation as the root user:
install -v -dm755 /usr/share/doc/bluez-5.84
install -v -m644 doc/*.txt /usr/share/doc/bluez-5.84
Command Explanations
--enable-library: This switch enables building the
BlueZ 4 compatibility library which is required by
some applications.
--disable-manpages: This switch disables generating
the manual pages. Add this switch if you don't have
docutils-0.22.3 installed.
ln -svf ../libexec/bluetooth/bluetoothd /usr/sbin:
This command makes access to the bluetooth daemon more convenient.
Configuring BlueZ
Configuration Files
/etc/bluetooth/main.conf is installed automatically
during the installation. Additionally, there are two supplementary
configuration files. You can optionally install the following files
as the root user:
cat > /etc/bluetooth/rfcomm.conf << "EOF"
# Start rfcomm.conf
# Set up the RFCOMM configuration of the Bluetooth subsystem in the Linux kernel.
# Use one line per command
# See the rfcomm man page for options
# End of rfcomm.conf
EOF
cat > /etc/bluetooth/uart.conf << "EOF"
# Start uart.conf
# Attach serial devices via UART HCI to BlueZ stack
# Use one line per device
# See the hciattach man page for options
# End of uart.conf
EOF
Systemd Bluez Services
To start the bluetoothd daemon at boot,
enable the previously installed systemd unit by
running the following command as the root user:
systemctl enable bluetooth
To start the obexd daemon for a user session (to
support some Bluetooth programs using it), enable the previously
installed systemd unit for all users by running the following command
as the root user:
systemctl enable --global obex
![[Note]](../images/note.png)
Note
Systemd will start the Bluetooth daemon
only when a bluetooth device is detected on the system.
Contents
Installed Programs:
bluemoon,
bluetoothctl,
bluetoothd (symlink),
btattach,
btmon,
hex2hcd,
l2ping,
l2test,
mpris-proxy, and
rctest
Installed Library:
libbluetooth.so
Installed Directories:
/etc/bluetooth,
/usr/{include,libexec}/bluetooth, and
/usr/share/doc/bluez-5.84
Short Descriptions
bluemoon |
is a Bluetooth configuration utility
|
bluetoothctl |
is the interactive Bluetooth control program
|
bluetoothd |
is the Bluetooth daemon
|
btmon |
provides access to the Bluetooth subsystem monitor
infrastructure for reading HCI traces
|
hex2hcd |
is used to convert a file needed by Broadcom devices
to hcd (Broadcom bluetooth firmware) format
|
l2ping |
is used to send a L2CAP echo request to the Bluetooth MAC
address given in dotted hex notation
|
l2test |
is a L2CAP testing program
|
rctest |
is used to test RFCOMM communications on the
Bluetooth stack
|
libbluetooth.so
|
contains the BlueZ 4 API functions
|