Skip to content

Commit 0b4f046

Browse files
committed
Make UsbService not check already plugged-in devices on launch
1 parent e009679 commit 0b4f046

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/Baballonia/Services/USBService.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@ public sealed class UsbService : IUsbService
1010
public event Action<string>? OnUsbDisconnected;
1111

1212
private static readonly IUsbEventWatcher UsbEventWatcher = new UsbEventWatcher(
13-
startImmediately: true,
14-
addAlreadyPresentDevicesToList: true,
15-
usePnPEntity: false,
16-
includeTTY: true);
13+
startImmediately: true, // True - This part is obvious
14+
addAlreadyPresentDevicesToList: false, // False - This part is less obvious.
15+
// Don't check devices that are already plugged in! This will spam the refresh queue on launch
16+
usePnPEntity: false, // False - PnP entity is slower, overkill for our use case
17+
includeTTY: true); // True - Legacy Babble Tracker show up under /dev/ttyACM*
1718

1819
private readonly TimeSpan _eventThrottleInterval = TimeSpan.FromSeconds(1);
1920
private DateTime _lastEventTime = DateTime.MinValue;

0 commit comments

Comments
 (0)