가 얘들 아 내가 일부 웹 사이트에서 일부 samlpe 코드를 발견 프로젝트 호출 "RFID 관리 시스템"RFID ReaderTrack 루프
을하고 그것으로 몇 가지 코드를 추가합니다.
내 RFID가 지금 mifare 카드에서 번호를 읽을 수 있지만 이미 문제가 있음 : Eclipse에서 "RUN"버튼을 누르지 않고 카드를 반복해서 읽으려면 내 RFID 시스템의 루프를 만드는 방법 U는 아두 이노 프로그래밍 인식 될 수
import java.util.List;
import javax.smartcardio.*;
import javax.xml.bind.DatatypeConverter;
public class Blog {
public static void main(String[] args) {
try {
// Display the list of terminals
TerminalFactory factory = TerminalFactory.getDefault();
List<CardTerminal> terminals = factory.terminals().list();
System.out.println("Terminals: " + terminals);
// Use the first terminal
CardTerminal terminal = terminals.get(0);
// Connect wit hthe card
Card card = terminal.connect("*");
System.out.println("card: " + card);
CardChannel channel = card.getBasicChannel();
// Send Select Applet command
ResponseAPDU answer = channel.transmit(new CommandAPDU(new byte[] { (byte)0xFF, (byte)0xCA, (byte)0x00, (byte)0x00, (byte)0x00 }));
// Send test command
answer = channel.transmit(new CommandAPDU(new byte[] { (byte)0xFF, (byte)0xCA, (byte)0x00, (byte)0x00, (byte)0x00 }));
byte r[] = answer.getData();
String hex = DatatypeConverter.printHexBinary(answer.getBytes());
System.out.println("Response: " + hex);
// Disconnect the card
card.disconnect(false);
} catch(Exception e) {
System.out.println("Ouch: " + e.toString());
}
}
}