Hi, every time I replug the same device, and call the method below, the SerialPortCallback will give me a list with duplicate devices, for example, if I have replugged the same device 3 times, it will end up giving me a list of 3 same devices.
public void listAll(Context context, IFoundUsbDevicesCallback callback) {
SerialPortCallback serialPortCallback = serialPorts -> {
List<IAdvancedUsbDevice> devices = new ArrayList<>();
for (UsbSerialDevice port : serialPorts) {
devices.add(new AdvancedUsbDevice(port));
}
callback.onFoundUsbDevices(devices);
};
SerialPortBuilder builder = SerialPortBuilder.createSerialPortBuilder(serialPortCallback);
builder.getSerialPorts(context);
}
Hi, every time I replug the same device, and call the method below, the
SerialPortCallback
will give me a list with duplicate devices, for example, if I have replugged the same device 3 times, it will end up giving me a list of 3 same devices.