简体   繁体   English

ACR122 USB SDK - JNI 调用 Winscard.dll

[英]ACR122 USB SDK - JNI calls to Winscard.dll

we have bought the ACR122 USB SDK for NFC testing.我们购买了 ACR122 USB SDK 用于 NFC 测试。 We would like to build the test desktop application for the ACR122U-A2 NFC reader.我们想为 ACR122U-A2 NFC 阅读器构建测试桌面应用程序。 We are developing it in Java on the Microsoft Windows 7 platform.我们正在微软 Windows 7 平台上的 Java 中开发它。

We expected that in order to use PC/SC from Winscard.dll we need to make JNI calls.我们预计,为了使用 Winscard.dll 中的 PC/SC,我们需要进行 JNI 调用。 In order to do that C/C++ wrapper library for JNI calls should be prepared.为了做到这一点,应该准备好用于 JNI 调用的 C/C++ 包装库。

I think this should be part of the SDK, because the example application references the JNI wrapper Jacspcsc.dll, but the library is not there.我认为这应该是 SDK 的一部分,因为示例应用程序引用了 JNI 包装器 Jacspcsc.dll,但该库不存在。 Has anybody similar experience?有没有人有类似的经历? Are there any JNI wrappers available for Winscard.dll?是否有任何可用于 Winscard.dll 的 JNI 包装器?

Thanks STeN谢谢斯滕

If you installed the PC/SC driver for the reader you can use the java smardcardio package (http://download.oracle.com/javase/6/docs/jre/api/security/smartcardio/spec/javax/smartcardio/package-summary.html) to communicate with the reader. If you installed the PC/SC driver for the reader you can use the java smardcardio package (http://download.oracle.com/javase/6/docs/jre/api/security/smartcardio/spec/javax/smartcardio/package -summary.html) 与读者交流。

TerminalFactory terminalFactory = TerminalFactory.getDefault();
CardTerminal terminal = terminalFactory.terminals().list().get(0);
Card card = terminal.connect("T=0");
CardChannel channel = card.getBasicChannel();

// Construct a command and transmit it
CommandAPDU command = new CommandAPDU(new byte[]{(byte)0x01, (byte)0x02, ...})
ResponseAPDU response = channel.transmit(command)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM