Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
nfc-index.qdoc
Go to the documentation of this file.
1// Copyright (C) 2013 Aaron McCarthy <mccarthy.aaron@gmail.com>
2// Copyright (C) 2021 The Qt Company Ltd.
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
4
5/*!
6\page qtnfc-index.html
7\title Qt NFC
8\brief Enables connectivity between NFC enabled devices.
9\ingroup technology-apis
10
11The NFC API provides connectivity between NFC enabled devices.
12
13Currently, the API is supported on \l{Qt for Android}{Android}, \l{Qt for
14iOS}{iOS} and \l{Qt for Linux}{Linux} using
15\l {https://github.com/linux-nfc/neard}{Neard} v0.14 or later.
16This module also provides limited access to readers supporting
17\l{PC/SC in Qt NFC}{PC/SC} specification on Linux, macOS, and Windows.
18
19NFC is a short-range (less than 20 centimeters) wireless technology
20with a maximum transfer rate of 424 Kbps. NFC is ideal for transferring
21small packets of data when two devices are placed together.
22
23The NFC module provides APIs for interacting with NFC Forum Tags and NFC Forum
24Devices. It can detect targets and losses, register NDEF message handlers, read
25and write NDEF messages on NFC Forum Tags, and send tag-specific commands.
26
27\section1 Using the Module
28
29\include {module-use.qdocinc} {using the c++ api} {NFC}
30
31\section2 Building with CMake
32
33\include {module-use.qdocinc} {building with cmake} {Nfc}
34
35\section2 Building with qmake
36
37\include {module-use.qdocinc} {building_with_qmake} {nfc}
38
39\section1 Articles and Guides
40
41\list
42 \li \l {Qt NFC Overview}
43 \li \l {Supported NFC Features}
44 \li \l {Qt NFC on Android}
45 \li \l {PC/SC in Qt NFC}
46\endlist
47
48\section1 Logging Categories
49
50The \l QtNfc module exports the following
51\l {Configuring Categories}{logging categories}:
52
53\table
54\header
55 \li Logging Category
56 \li Description
57\row
58 \li qt.nfc.neard
59 \li Enables logging of the Neard/Linux implementation
60\endtable
61
62\section1 Examples
63
64\list
65 \li \l {annotatedurl}{Annotated URL}
66 \li \l {ndefeditor}{NDEF Editor}
67\endlist
68
69\section1 Reference
70
71\list
72 \li \l {Qt NFC C++ Classes}{C++ Classes}
73\endlist
74
75\section1 Security Considerations
76
77The content of an NFC tag cannot be treated as a trusted input. It's the
78application developer's responsibility to validate the data before using it.
79
80\section2 URIs
81
82Functions such as \l QNdefNfcUriRecord::uri() and
83\l QNdefNfcSmartPosterRecord::uri() return URIs decoded directly from tag
84content. Applications can, for example, verify that the scheme is one the
85application expects to receive (for example, \c https rather than \c file
86or \c javascript) before opening, loading, or acting on a returned URI.
87
88\section2 Icon Data
89
90Functions such as \l QNdefNfcIconRecord::data() and
91\l QNdefNfcSmartPosterRecord::icon() return raw byte arrays containing icon
92data embedded in the tag. Since the MIME type and content are both provided
93by the tag author, the actual bytes may not conform to the claimed type.
94
95Applications should verify the result after decoding rather than assuming the
96data is valid. As an example, passing the data directly to \l QImage is
97generally safe, as it handles validation. However, it is advised to perform
98additional validation when processing the data manually or using non-Qt tools.
99
100\section1 Module Evolution
101
102\l {Changes to Qt NFC} lists important changes in the module API and
103functionality that were done for the Qt 6 series of Qt.
104
105\section1 Licenses
106
107Qt NFC is available under commercial licenses from \l{The Qt Company}.
108In addition, it is available under free software licenses. Since Qt 5.4,
109these free software licenses are
110\l{GNU Lesser General Public License, version 3}, or
111the \l{GNU General Public License, version 2}.
112See \l{Qt Licensing} for further details.
113*/