PC/SC 在Qt NFC
在 macOS 和 Windows 系统上,PC/SC 支持通过原生 API 实现;在其他平台上则通过PCSCLite库实现。该 API 既可用于访问有线智能卡,也可用于访问无线智能卡和存储卡。
限制
- 当前的 API 无法区分不同的读卡器/插槽。
- 仅为 NFC Type 4 标签提供 NDEF 访问功能。
- 其他在卡片上启动交易的应用程序可能会阻止 Qt 应用程序使用 Qt NFC API。
- QNearFieldTarget::sendCommand() 用于 PC/SC 目标时,会启动一项交易,该交易将保持活动状态,直到调用QNearFieldTarget::disconnect() 为止。此交易会阻止其他应用程序访问该目标。
- 后端会轮询新的标签,这意味着在报告新标签之前,可能会存在长达整个轮询间隔的延迟。默认轮询间隔为 100 毫秒。可以通过将环境变量
QT_NFC_POLL_INTERVAL_MS设置为以毫秒为单位的整数值来调整该间隔。
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.