Qt NFC

NFC API 在启用 NFC 的设备之间提供连接。

目前,API 支持在 Android and iOS .

概述

NFC is an extremely short-range (less than 20 centimeters) wireless technology and has a maximum transfer rate of 424 kbit/s. NFC is ideal for transferring small packets of data when two devices are touched together.

The NFC API provides APIs for interacting with NFC Forum Tags and NFC Forum Devices, including target detection and loss, registering NDEF message handlers, reading and writing NDEF messages on NFC Forum Tags and sending tag specific commands.

使用模块

使用 Qt 模块要求直接或透过其它依赖链接到模块库。一些构建工具为此有贡献支持,包括 CMake and qmake .

构建采用 CMake

使用 find_package() 命令去定位所需模块组件,在 Qt6 包:

find_package(Qt6 COMPONENTS Nfc REQUIRED)
target_link_libraries(mytarget PRIVATE Qt::Nfc)
					

另请参阅 构建采用 CMake 概述。

采用 qmake 构建

要配置采用 qmake 构建模块,添加模块作为值为 QT 变量在工程的 .pro 文件:

QT += nfc
					

模块演变

Changes to Qt NFC 列出了 Qt 的 Qt 6 系列在模块 API 和功能上所做出的重要改变。

许可

Qt NFC 在商业许可下是可用的来自 Qt 公司 。此外,它在自由软件许可下也是可用的。从 Qt 5.4 起,这些自由软件许可是 GNU LGPL (次一般公共许可) 第 3 版 ,或 GNU GPL (一般公共许可) 第 2 版 。见 Qt 许可 进一步了解细节。

指南

参考

范例