ねえ、私は、プロジェクトの呼び出しをしたいだろう人は「RFID管理システム」RFID ReaderTrackループ
私はいくつかのウェブサイトからいくつかのsamlpeコードを発見し、それにいくつかのコードを追加します。
私のRFIDはmifareカードから数値を読み取ることができますが、すでに問題に直面しています:Eclipseで "RUN"ボタンを押さずに、何度もカードを読み取るためにRFIDマシンのループを作成する方法Uは、右?そこに、Arduinoのプログラミングを意識するかもしれません
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());
}
}
}