summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/doc/src/bluetooth-index.qdoc
diff options
context:
space:
mode:
Diffstat (limited to 'src/bluetooth/doc/src/bluetooth-index.qdoc')
-rw-r--r--src/bluetooth/doc/src/bluetooth-index.qdoc156
1 files changed, 70 insertions, 86 deletions
diff --git a/src/bluetooth/doc/src/bluetooth-index.qdoc b/src/bluetooth/doc/src/bluetooth-index.qdoc
index 0f5b96d6..ff6bf037 100644
--- a/src/bluetooth/doc/src/bluetooth-index.qdoc
+++ b/src/bluetooth/doc/src/bluetooth-index.qdoc
@@ -1,29 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\page qtbluetooth-index.html
@@ -40,10 +16,9 @@ Currently, the API is supported on the following platforms:
\li API Feature
\li \l {Qt for Android}{Android}
\li \l {Qt for iOS}{iOS}
- \li \l {Qt for Linux/X11}{Linux (BlueZ 4.x/5.x)}
+ \li \l {Qt for Linux/X11}{Linux (BlueZ 5.x)}
\li \l \macos
- \li \l {Qt for UWP}{UWP (Universal Windows Platform)}
- \li \l {Qt for Windows}{Win32}
+ \li \l {Qt for Windows}{Windows}
\row
\li Classic Bluetooth
\li x
@@ -51,7 +26,6 @@ Currently, the API is supported on the following platforms:
\li x
\li x
\li x
- \li x
\row
\li Bluetooth LE Central
\li x
@@ -59,7 +33,6 @@ Currently, the API is supported on the following platforms:
\li x
\li x
\li x
- \li x
\row
\li Bluetooth LE Peripheral
\li x
@@ -67,67 +40,86 @@ Currently, the API is supported on the following platforms:
\li x
\li x
\li
- \li
-\row
- \li Bluetooth LE Advertisement & Scanning
- \li
- \li
- \li
- \li
- \li
- \li
\endtable
-Qt 5.14 adds a native Win32 port supporting Classic Bluetooth on Windows 7 or newer,
-and Bluetooth LE on Windows 8 or newer. It must be enabled at build time by configuration
-option -native-win32-bluetooth. The UWP backend is used by default if this option is not
-set and the Win32 target platform supports the required UWP APIs (minimal requirement is
-Windows 10 version 1507, with slightly improved service discovery since Windows 10 version
-1607).
-
\section1 Overview
Bluetooth is a short-range (less than 100 meters) wireless technology. It
-has a reasonably high data transfer rate of 2.1 Mbit/s, which makes it ideal
+has a data transfer rate of 2.1 Mbps, which makes it ideal
for transferring data between devices. Bluetooth connectivity is based on
basic device management, such as scanning for devices, gathering information
about them, and exchanging data between them.
-Qt Bluetooth supports Bluetooth Low Energy development for client/central role use cases.
-Further details can be found in the
+Qt Bluetooth supports Bluetooth Low Energy development for client/central role
+use cases. Further details can be found in the
\l {Bluetooth Low Energy Overview}{Bluetooth Low Energy Overview} section.
-A new addition since the Qt Bluetooth 5.7 release covers support for Bluetooth Low Energy
-applications performing the peripheral/server role. This new API remains in Technology Preview.
+\section1 Using the Module
+
+\include {module-use.qdocinc} {using the c++ api}
+
+\section2 Building with CMake
-\section1 Getting Started
+\include {module-use.qdocinc} {building with cmake} {Bluetooth}
-To use the C++ library in your application, add the following configuration
-option to your \c .pro file:
+\section2 Building with qmake
-\snippet snippets.pro contacts project modification
+\include {module-use.qdocinc} {building_with_qmake} {bluetooth}
-To use the classes of the module in your application you need the following
-import statement in your \c .qml file:
+\section1 Permissions
-\snippet doc_src_qtbluetooth.qml import
+Starting from Qt 6.6, the Qt Bluetooth module uses new \l QPermission API
+to handle \l {QBluetoothPermission}{Bluetooth} permissions. This means that Qt
+itself no longer queries for these permissions, so this needs to be done
+directly from the client application.
+
+Please refer to the \l {Application Permissions} page for an example of how
+to integrate the new \l QPermission API into the application.
\section1 Related Information
\section2 Building Qt Bluetooth
-Despite the fact that the module can be built for all Qt platforms,
-the module is not ported to all of them. Not supported platforms
-employ a fake or dummy backend which is automatically selected when the
-platform is not supported. The dummy backend reports appropriate error messages
-and values which allow the Qt Bluetooth developer to detect at runtime that the
-current platform is not supported. The dummy backend is also selected on Linux if
-BlueZ development headers are not found during build time or Qt was built without
-Qt D-Bus support.
+Even though the module can be built for all Qt platforms, the module is not
+ported to all of them. Non-supported platforms employ a dummy backend that is
+automatically selected when the platform is not supported. The dummy backend
+reports appropriate error messages and values, which enables you to detect at
+runtime that the current platform is not supported. The dummy backend is also
+selected on Linux if BlueZ development headers are not found during build time
+or Qt was built without Qt D-Bus support.
The usage of the dummy backend is highlighted via an appropriate warning while building and running.
-\section2 Guides
+\section3 Linux Specific
+
+Since Qt 6.5 the Linux peripheral support has two backend alternatives:
+BlueZ DBus and Bluetooth Kernel API. The DBus backend is the default
+backend since Qt 6.7.
+
+BlueZ DBus is the newer BlueZ stack and possibly the eventual successor of the
+older Kernel API. It is a bit more limited in terms of features, but in a
+typical usage this should not matter. One notable benefit of using the DBus
+backend is that the user process no longer needs to have the
+\e CAP_NET_ADMIN capability (for example by running as \c root user).
+
+The DBus backend requires BlueZ version 5.56 or higher, and that it provides
+the needed DBus APIs. If these requirements are not met, Qt automatically
+falls back to the Bluetooth Kernel API backend.
+
+The older kernel backend can also be selected manually by setting the
+\e QT_BLUETOOTH_USE_KERNEL_PERIPHERAL environment variable.
+
+\section3 \macos Specific
+The Bluetooth API on \macos requires a certain type of event dispatcher
+that in Qt causes a dependency to \l QGuiApplication. However, you can set the
+environment variable \c {QT_EVENT_DISPATCHER_CORE_FOUNDATION=1} to circumvent
+this issue.
+
+Applications that don't use Classic Bluetooth will find a subset of QtBluetooth
+is available, as CoreBluetooth (Bluetooth LE) don't require \l QApplication or
+\l QGuiApplication.
+
+\section2 Articles and Guides
\list
\li \l {Qt Bluetooth Overview}{Classic Bluetooth Overview}
\li \l {Bluetooth Low Energy Overview}
@@ -135,7 +127,6 @@ The usage of the dummy backend is highlighted via an appropriate warning while b
\section2 Reference
\list
- \li \l {Qt Bluetooth QML Types}{QML Types}
\li \l {Qt Bluetooth C++ Classes}{C++ Classes}
\endlist
@@ -164,20 +155,14 @@ The \l QtBluetooth module exports the following
\li qt.bluetooth.osx
\li Enables logging of the \l {Qt for macOS} {macOS} implementation
\row
- \li qt.bluetooth.qml
- \li Enables logging of the QtBluetooth QML implementation
-\row
- \li qt.bluetooth.winrt
- \li Enables logging of the \l {Qt for UWP}{UWP (Universal Windows Platform)}
- implementation
-\row
\li qt.bluetooth.windows
- \li Enables logging of the \l {Qt for Windows} {Win32} implementation
+ \li Enables logging of the \l {Qt for Windows} {Windows} implementation
\endtable
-Logging categories can be used to enable additional warning and debug output
-for QtBluetooth. More detailed information about logging can be found in \l QLoggingCategory.
-A quick way to enable all QtBluetooth logging is to add the following line to the \c main() function:
+Logging categories enable additional warning and debug output for QtBluetooth.
+More detailed information about logging is found in \l QLoggingCategory. A
+quick way to enable all QtBluetooth logging is to add the following line to the
+\c main() function:
\code
QLoggingCategory::setFilterRules(QStringLiteral("qt.bluetooth* = true"));
@@ -187,10 +172,6 @@ A quick way to enable all QtBluetooth logging is to add the following line to th
\list
\li QML
\list
- \li \l {scanner}{QML Bluetooth Scanner}
- \li \l {picturetransfer}{QML Bluetooth Picture Push}
- \li \l {pingpong}{QML Bluetooth PingPong}
- \li \l {chat}{QML Bluetooth Chat}
\li \l {heartrate-game}{Bluetooth Low Energy Heart Rate Game}
\li \l {heartrate-server}{Bluetooth Low Energy Heart Rate Server}
\li \l {lowenergyscanner}{Bluetooth Low Energy Scanner}
@@ -198,11 +179,14 @@ A quick way to enable all QtBluetooth logging is to add the following line to th
\li C++
\list
\li \l {btchat}{Bluetooth Chat}
- \li \l {btscanner}{Bluetooth Scanner}
- \li \l {btfiletransfer}{Bluetooth File Transfer}
\endlist
\endlist
+\section1 Module Evolution
+
+\l{Changes to Qt Bluetooth} lists important changes in the module
+API and functionality that were done for the Qt 6 series of Qt.
+
\section1 Licenses and Attributions
Qt Bluetooth is available under commercial licenses from \l{The Qt Company}.