// Copyright (C) 2013 Aaron McCarthy <mccarthy.aaron@gmail.com>
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only

/*!
\page qtnfc-index.html
\title Qt NFC
\brief Enables connectivity between NFC enabled devices.
\ingroup technology-apis

The NFC API provides connectivity between NFC enabled devices.

Currently, the API is supported on \l{Qt for Android}{Android}, \l{Qt for
iOS}{iOS} and \l{Qt for Linux}{Linux} using
\l {https://github.com/linux-nfc/neard}{Neard} v0.14 or later.
This module also provides limited access to readers supporting
\l{PC/SC in Qt NFC}{PC/SC} specification on Linux, macOS, and Windows.

NFC is a short-range (less than 20 centimeters) wireless technology
with a maximum transfer rate of 424 Kbps. NFC is ideal for transferring
small packets of data when two devices are placed together.

The NFC module provides APIs for interacting with NFC Forum Tags and NFC Forum
Devices. It can detect targets and losses, register NDEF message handlers, read
and write NDEF messages on NFC Forum Tags, and send tag-specific commands.

\section1 Using the Module

\include {module-use.qdocinc} {using the c++ api} {NFC}

\section2 Building with CMake

\include {module-use.qdocinc} {building with cmake} {Nfc}

\section2 Building with qmake

\include {module-use.qdocinc} {building_with_qmake} {nfc}

\section1 Articles and Guides

\list
    \li \l {Qt NFC Overview}
    \li \l {Supported NFC Features}
    \li \l {Qt NFC on Android}
    \li \l {PC/SC in Qt NFC}
\endlist

\section1 Logging Categories

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

\table
\header
    \li Logging Category
    \li Description
\row
    \li qt.nfc.neard
    \li Enables logging of the Neard/Linux implementation
\endtable

\section1 Examples

\list
    \li \l {annotatedurl}{Annotated URL}
    \li \l {ndefeditor}{NDEF Editor}
\endlist

\section1 Reference

\list
    \li \l {Qt NFC C++ Classes}{C++ Classes}
\endlist

\section1 Security Considerations

The content of an NFC tag cannot be treated as a trusted input. It's the
application developer's responsibility to validate the data before using it.

\section2 URIs

Functions such as \l QNdefNfcUriRecord::uri() and
\l QNdefNfcSmartPosterRecord::uri() return URIs decoded directly from tag
content. Applications can, for example, verify that the scheme is one the
application expects to receive (for example, \c https rather than \c file
or \c javascript) before opening, loading, or acting on a returned URI.

\section2 Icon Data

Functions such as \l QNdefNfcIconRecord::data() and
\l QNdefNfcSmartPosterRecord::icon() return raw byte arrays containing icon
data embedded in the tag. Since the MIME type and content are both provided
by the tag author, the actual bytes may not conform to the claimed type.

Applications should verify the result after decoding rather than assuming the
data is valid. As an example, passing the data directly to \l QImage is
generally safe, as it handles validation. However, it is advised to perform
additional validation when processing the data manually or using non-Qt tools.

\section1 Module Evolution

\l {Changes to Qt NFC} lists important changes in the module API and
functionality that were done for the Qt 6 series of Qt.

\section1 Licenses

Qt NFC is available under commercial licenses from \l{The Qt Company}.
In addition, it is available under free software licenses. Since Qt 5.4,
these free software licenses are
\l{GNU Lesser General Public License, version 3}, or
the \l{GNU General Public License, version 2}.
See \l{Qt Licensing} for further details.
*/
