mirror of
https://github.com/Vale54321/schafkopf-bot.git
synced 2025-12-15 11:19:33 +01:00
added env support for COM port (#24)
This commit is contained in:
committed by
GitHub
parent
09c38c81dd
commit
c17202a83b
@@ -10,7 +10,7 @@ public class UsbCardReader extends CardReader {
|
||||
|
||||
private volatile boolean isRunning = true;
|
||||
Dotenv dotenv = Dotenv.configure().directory("./").load();
|
||||
private String PORT_NAME = dotenv.get("COM_PORT");
|
||||
private final String comPort = dotenv.get("COM_PORT");
|
||||
|
||||
/**
|
||||
* Creates an Instance of the KartenLeser.
|
||||
@@ -33,14 +33,14 @@ public class UsbCardReader extends CardReader {
|
||||
SerialPort selectedPort = null;
|
||||
|
||||
for (SerialPort port : ports) {
|
||||
if (port.getSystemPortName().equals(this.PORT_NAME)) {
|
||||
if (port.getSystemPortName().equals(this.comPort)) {
|
||||
selectedPort = port;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (selectedPort == null) {
|
||||
System.out.println(this.PORT_NAME + " not found");
|
||||
System.out.println(this.comPort + " not found");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user