编程 PC/SC 阅读器时的 ATR 命令 [英] ATR command when programming PC/SC reader

查看:123
本文介绍了编程 PC/SC 阅读器时的 ATR 命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经检查了 MIFARE Ultralight 和 TOPAZ/Jewel IC 标签的编程接口.API 很好地描述了如何将字节保存在卡上,如何寻址内存块,如何进行所有操作,如读取、全部读取、使用 OTP(一次性可编程)功能、如何读取 ROM 字节、如何从空闲状态切换到就绪状态(REQA,WUPA 命令),它说明命令是否受 CRC 保护,如何访问标签 UID 等.

I have checked the programming interface for the MIFARE Ultralight and TOPAZ/Jewel IC tags. The API quite nicely describes how the bytes are saved on the card, how to address the memory blocks, how to make all operations like read, read-all, use of the OTP (One Time Programmable) function, how to read ROM bytes, how to switch from idle to ready state (REQA, WUPA commands), it says if commands are CRC protected, how to access the tag UID, etc.

当开始对 NFC 阅读器(ACR122U 或 SCL010)进行编程时,我发现 PCD(阅读器)和 PICC(标签)之间的所有通信都以 ATR(应答重置)命令开始,如 Internet 上所述PCD 发送给 PICC 用于识别目的的命令.

When stared to program the NFC reader (ACR122U or SCL010) I found that all communication between PCD (reader) an PICC (tag) starts with the ATR (Answer-To-Reset) command, which is as described on Internet a command that the PCD sends to PICC for identification purposes.

但没有任何标签文档提到 ATR 命令——所有与标签通电 (PQR) 的通信都以 REQA、WUPA 命令开始,以便将卡切换到就绪模式.

But none of the tags documentation mentions the ATR command – all communication with tags when they become powered (PQR) starts with REQA, WUPA commands in order to switch the card to the Ready mode.

我的理解是 ATR 是由 PC/SC 基于读卡器与之通信的 NFC 卡构建的.一旦阅读器检测到标签是什么类型的技术,它就会创建 ATR.此外,根据文档,对于相同的 NFC 标签,不同 NFC 阅读器的 ATR 是不同的.

My understanding is that ATR is built by PC/SC based on the NFC card the reader communicated with. Once the reader detect what type of technology is the tag based on it creates the ATR. Also according to documentation ATR for different NFC readers are different for the same NFC tags.

我说得对吗?PC/SC 是否构建 ATR?

Am I right? Does the PC/SC build the ATR?

BR斯坦

推荐答案

简答:

  • 您对 PCSC 阅读器生成 ATR 的看法是正确的
  • 我认为无论非接触式卡的读卡器如何,ATR 都将保持不变

长答案:

ATR 用于接触式卡片,并在 ISO 7816 中指定.对于非接触式卡片,生成 ATR 的是 PC/SC 读卡器 (IFD).

ATR is for contact cards and is specified in ISO 7816. For contacless cards, it is the PC/SC reader (IFD) that generates the ATR.

ATR 的构建基于:

  • 适用于 ISO 14443 A 类卡的 ATS(选择答案)
  • ISO 14443 Type B 卡的 ATQB 和 ATTRIB 字节

ATR 将采用以下形式3B 8X 80 01 HB_ATS Parity_Byte其中 X 是 ATS 的历史字节 (HB_ATS) 的字节数.

The ATR will be of the form 3B 8X 80 01 HB_ATS Parity_Byte where X is the number of bytes of Historical Bytes of ATS (HB_ATS).

非接触式卡的 ATR 的确切结构在第 3.1.3.2.3 节中给出PC/SC 规格.

The exact construction of ATR for contactless cards is given in section 3.1.3.2.3 of the PC/SC spec.

鉴于唯一的变量是 ATS,无论读者如何,它都应该是相同的.

Given that the only variable is ATS, it should be the same regardless of the reader.

--Sid

这篇关于编程 PC/SC 阅读器时的 ATR 命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆