ACR122 - 卡模拟
如何让 NFC 非接触式读卡器 ACR122U 充当标签(卡模拟模式)? 招股说明书声称该设备可以进行卡模拟,但 SDK 似乎没有提供此功能的示例或文档。
有人知道该怎么做吗? 是否需要额外的软件? 请注意,我的目标平台是 MS Windows。
提前致谢
How can I get the NFC contactless reader ACR122U to behave as a tag (card emulation mode)?
The prospectus claims that the device can do card emulation, but the SDK does not seem to provide an example or documentation for this feature.
Does anybody know how to do this?
Is there additional software required?
Please note that my target platform is MS Windows.
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
对于“卡模拟”或换句话说,“配置为目标并等待启动器”,请参阅此处:http://code.google.com/p/nfcip-java/source/browse/trunk/nfcip-java/doc/ACR122_PN53x.txt< /a>
这是发起者激活此目标时的响应:
让我知道它是否有效!
For "Card Emulation" or in other words, "Configure as target and wait for initiators", please refer to here: http://code.google.com/p/nfcip-java/source/browse/trunk/nfcip-java/doc/ACR122_PN53x.txt
This is the response when an initiator activated this target:
Let me know if it works!
您也可以尝试以十六进制发送以下 ADPU,将读卡器置于“卡模拟”模式:
FF 00 00 00 27 D4 8C 00 08 00 12 34 56 40 01 FE A2 A3 A4 A5 A6 A7 C0 C1 C2 C3 C4 C5 C6 C7 FF FF AA 99 88 77 66 55 44 33 22 11 00 00
Also you can try to send the following ADPU in HEX to put the reader in "Card emulation" mode:
FF 00 00 00 27 D4 8C 00 08 00 12 34 56 40 01 FE A2 A3 A4 A5 A6 A7 C0 C1 C2 C3 C4 C5 C6 C7 FF FF AA 99 88 77 66 55 44 33 22 11 00 00
为了使 ACR122(或者更确切地说是其中的 PN532 NFC 控制器芯片)进入卡模拟模式,您需要执行以下操作:
ReadRegister:
<前><代码>> FF000000 08 D406 6305 630D 6338
< D507 xx yy zz 9000
更新寄存器值:
<前><代码>xx = xx | 0x004; // CIU_TxAuto |= InitialRFOn
yy = yy & 0x0EF; // CIU_ManualRCV &= ~ParityDisable
zz = zz & 0x0F7; // CIU_Status2 &= ~MFCrypto1On
WriteRegister:
<前><代码>> FF000000 11 D408 6302 80 6303 80 6305 xx 630D yy 6338 zz
< D509 9000
设置参数:
<前><代码>> FF000000 03 D412 30
< D513 9000
TgInitAsTarget
<前><代码>> FF000000 27 D48C 05 0400 123456 20 000000000000000000000000000000000000 00000000000000000000 00 00
< D58D xx ... 9000
其中
xx
应等于 0x08。使用一系列 TgGetData 和 TgSetData 命令进行通信:
<前><代码>> FF000000 02 D4869000
< D587 xx
其中
xx
是状态码(成功时应为0x00
),C-APDU是从阅读器发送的命令。<前><代码>> FF000000 yy D48E
< D587xx 9000
其中
yy
是 2 + R-APDU(响应)的长度,xx
是状态代码(应为0x00
其中For getting the ACR122 (or rather the PN532 NFC controller chip inside it) into card emulation mode, you would do about the following:
ReadRegister:
Update register values:
WriteRegister:
SetParameters:
TgInitAsTarget
Where
xx
should be equal to 0x08.Communicate using a sequence of TgGetData and TgSetData commands:
Where
xx
is the status code (should be0x00
for success) and C-APDU is the command sent from the reader.Where
yy
is 2 + the length of the R-APDU (response) andxx
is the status code (should be0x00
for success).您可以使用 LibNFC。它有这方面的示例代码。
不幸的是,我仍然没有在 Windows 中正常工作。您可能需要为特定驱动程序编译 libnfc。
此外,许多库似乎对 ACR122u 的支持很差。显然它并不是真正为这种用途而设计的。卡模拟也存在一些特殊问题(例如超时)。我们真的需要停下来看看 ACR122u。我刚刚买了一些流行且容易买到的东西,但现在后悔了。
对于未来遇到此问题的浏览器/搜索者:请检查 libnfc 网站上的兼容性部分并购买他们推荐的东西!
You can use LibNFC. It has example code for this.
I still never got this working properly in Windows unfortunately. You will probably have to compile libnfc for specific drivers.
Also, the ACR122u seems to be pretty poorly supported by many libraries. Apparently it's not really designed for this use. There are particular issues for card emulation too (such as the timeout). We really all need to stop by the ACR122u. I just bought what was popular and easy to get hold of but regret it now.
To future browsers/searchers coming across this: please check the compatibility section on the libnfc site and buy something that they recommend!