bugfix: somehow console shows duplicates in ports list
This commit is contained in:
parent
6b23a2f22b
commit
c246d0506f
|
@ -17,6 +17,7 @@ import java.io.Closeable;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
import java.util.TreeSet;
|
||||||
import java.util.concurrent.*;
|
import java.util.concurrent.*;
|
||||||
|
|
||||||
import static com.devexperts.logging.Logging.getLogging;
|
import static com.devexperts.logging.Logging.getLogging;
|
||||||
|
@ -117,10 +118,11 @@ public class LinkManager implements Closeable {
|
||||||
|
|
||||||
public static String[] getCommPorts() {
|
public static String[] getCommPorts() {
|
||||||
SerialPort[] ports = SerialPort.getCommPorts();
|
SerialPort[] ports = SerialPort.getCommPorts();
|
||||||
String[] result = new String[ports.length];
|
// wow sometimes driver returns same port name more than once?!
|
||||||
for (int i = 0; i < ports.length; i++)
|
TreeSet<String> names = new TreeSet<>();
|
||||||
result[i] = ports[i].getSystemPortName();
|
for (SerialPort port : ports)
|
||||||
return result;
|
names.add(port.getSystemPortName());
|
||||||
|
return names.toArray(new String[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public BinaryProtocol getCurrentStreamState() {
|
public BinaryProtocol getCurrentStreamState() {
|
||||||
|
|
|
@ -6,7 +6,7 @@ import java.net.URL;
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
|
|
||||||
public class rusEFIVersion {
|
public class rusEFIVersion {
|
||||||
public static final int CONSOLE_VERSION = 20211023;
|
public static final int CONSOLE_VERSION = 20211027;
|
||||||
public static AtomicReference<String> firmwareVersion = new AtomicReference<>("N/A");
|
public static AtomicReference<String> firmwareVersion = new AtomicReference<>("N/A");
|
||||||
|
|
||||||
public static long classBuildTimeMillis() {
|
public static long classBuildTimeMillis() {
|
||||||
|
|
Loading…
Reference in New Issue