0

我正在尝试向包含 ISO7816 标签的 NFC 卡发送 APDU 命令,我将打开会话:

readerSession = NFCTagReaderSession(pollingOption: [.iso14443], delegate: self, queue: nil)
readerSession?.begin()

一旦检测到标签,

session.connect(to: tags.first!)

并开始一一发送APDU命令。

detectedTag.sendCommand(apdu: apduCommand) { (response: Data, sw1: UInt8, sw2: UInt8, error: Error?)

但大约 20 秒后 NFCTagReaderSession 发送错误:

Error Domain=NFCError
Code=201 "Session timeout"
UserInfo={NSLocalizedDescription=Session timeout}

是否有可能增加与已连接标签的通信超时?我尝试寻找 NFCTagReaderSession 的间隔或超时属性。但没有运气。

4

0 回答 0