gpt4 book ai didi

java与NFC通信(PC/SC)

转载 作者:太空宇宙 更新时间:2023-11-04 11:18:43 29 4
gpt4 key购买 nike

有没有办法让 java 使用 javax.smartcardio.TerminalFactory 识别我的 NFC 读卡器?

我正在使用 Ubuntu 13.04 并使用 pcsc_scan 我能够读取卡片:

Reader 0: SCL010 Contactless Reader [SCL010 Contactless Reader] (21160951211983) 00 00
Card state: Card inserted,
ATR: 3B 8F 80 01 80 4F 0C A0 00 00 03 06 03 00 01 00 00 00 00 6A

ATR: 3B 8F 80 01 80 4F 0C A0 00 00 03 06 03 00 01 00 00 00 00 6A
+ TS = 3B --> Direct Convention
+ T0 = 8F, Y(1): 1000, K: 15 (historical bytes)
TD(1) = 80 --> Y(i+1) = 1000, Protocol T = 0
-----
TD(2) = 01 --> Y(i+1) = 0000, Protocol T = 1
-----
+ Historical bytes: 80 4F 0C A0 00 00 03 06 03 00 01 00 00 00 00
Category indicator byte: 80 (compact TLV data object)
Tag: 4, len: F (initial access data)
Initial access data: 0C A0 00 00 03 06 03 00 01 00 00 00 00
+ TCK = 6A (correct checksum)

Possibly identified card (using /usr/share/pcsc/smartcard_list.txt):
3B 8F 80 01 80 4F 0C A0 00 00 03 06 03 00 01 00 00 00 00 6A
3B 8F 80 01 80 4F 0C A0 00 00 03 06 .. 00 01 00 00 00 00 ..
Mifare Standard 1K (as per PCSC std part3)
3B 8F 80 01 80 4F 0C A0 00 00 03 06 03 00 01 00 00 00 00 6A
3B 8F 80 01 80 4F 0C A0 00 00 03 06 03 .. .. 00 00 00 00 ..
RFID - ISO 14443 Type A Part 3 (as per PCSC std part3)
3B 8F 80 01 80 4F 0C A0 00 00 03 06 03 00 01 00 00 00 00 6A

但是用

CardTerminals terminals = TerminalFactory.getDefault().terminals();
List<CardTerminal> list = terminals.list();

总是返回一个空的列表

是不是驱动问题?

最佳答案

只需使用 -Dsun.security.smartcardio.library=/lib/x86_64-linux-gnu/libpcsclite.so.1 运行程序即可!

关于java与NFC通信(PC/SC),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19575931/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com