/****************************************************************************
**
** 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$
**
****************************************************************************/

/*!
\page qtbluetooth-index.html
\title Qt Bluetooth
\brief Qt Bluetooth enables connectivity between Bluetooth enabled devices.
\ingroup technology-apis

The Bluetooth API provides connectivity between Bluetooth enabled devices.

Currently, the API is supported on the following platforms:

\table
\header
    \li API Feature
    \li \l {Qt for Android}{Android}
    \li \l {Qt for iOS}{iOS}
    \li \l {Qt for Linux/X11}{Linux (BlueZ 5.x)}
    \li \l \macos
    \li \l {Qt for Windows}
\row
    \li Classic Bluetooth
    \li x
    \li
    \li x
    \li x
    \li x
\row
    \li Bluetooth LE Central
    \li x
    \li x
    \li x
    \li x
    \li x
\row
    \li Bluetooth LE Peripheral
    \li x
    \li x
    \li x
    \li x
    \li
\row
    \li Bluetooth LE Advertisement & Scanning
    \li
    \li
    \li
    \li
    \li
\endtable

\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
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
\l {Bluetooth Low Energy Overview}{Bluetooth Low Energy Overview} section.

\include module-use.qdocinc using qt module
\snippet doc/snippets/CMakeLists.txt 0

See also the \l {Build with CMake} overview.

\section2 Building with \c qmake

Add \c bluetooth to the \c QT variable:

\snippet snippets.pro contacts project modification

\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.

The usage of the dummy backend is highlighted via an appropriate warning while building and running.

\section3 \macos Specific
The Bluetooth API on \macos requires a certain type of event dispatcher
that in Qt causes a dependency to 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) do not require either of
QApplication or QGuiApplication.

\section2 Guides
\list
    \li \l {Qt Bluetooth Overview}{Classic Bluetooth Overview}
    \li \l {Bluetooth Low Energy Overview}
\endlist

\section2 Reference
\list
    \li \l {Qt Bluetooth C++ Classes}{C++ Classes}
\endlist

\section2 Logging Categories

The \l QtBluetooth module exports the following
\l {Configuring Categories}{logging categories}:

\table
\header
    \li Logging Category
    \li Description
\row
    \li qt.bluetooth
    \li Enables logging of cross platform code path in QtBluetooth
\row
    \li qt.bluetooth.android
    \li Enables logging of the \l {Qt for Android} {Android} implementation
\row
    \li qt.bluetooth.bluez
    \li Enables logging of the BLuez/Linux implementation
\row
    \li qt.bluetooth.ios
    \li Enables logging of the \l {Qt for iOS} {iOS} implementation
\row
    \li qt.bluetooth.osx
    \li Enables logging of the \l {Qt for macOS} {macOS} implementation
\row
    \li qt.bluetooth.windows
    \li Enables logging of the \l {Qt for 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:

\code
    QLoggingCategory::setFilterRules(QStringLiteral("qt.bluetooth* = true"));
\endcode

\section2 Examples
\list
    \li QML
    \list
        \li \l {pingpong}{QML Bluetooth PingPong}
        \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}
    \endlist
    \li C++
    \list
        \li \l {btchat}{Bluetooth Chat}
        \li \l {btscanner}{Bluetooth Scanner}
    \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}.
In addition, it is available under the
\l{GNU Lesser General Public License, version 3}, or
the \l{GNU General Public License, version 2}.
See \l{Qt Licensing} for further details.

On Linux, Qt Bluetooth uses a separate executable, \c sdpscanner,
to integrate with the official Linux bluetooth protocol stack
BlueZ. BlueZ is available under the \l{GNU General Public License,
version 2}.

\generatelist{groupsbymodule attributions-qtbluetooth}
*/
