feat: support Linux virtual USB in Avalonia desktop

This commit is contained in:
tongtong committed 2026-11-13 10:01:58 +08:00
1 parent ac8eb72319
commit de6ecae54f
8 files changed
+42 -12

No files matched your search

+2 -2
View File
@@ -25,7 +25,7 @@ public partial class MainViewModel : ObservableObject, IDisposable
[ObservableProperty] private int maxSize = 1920;
[ObservableProperty] private int maxFps = 60;
[ObservableProperty] private bool usbMode;
[ObservableProperty] private string usbipPath = WindowsUsbSession.DefaultUsbipPath();
[ObservableProperty] private string usbipPath = UsbSession.DefaultUsbipPath();
[ObservableProperty] private int usbPort = 3240;
[ObservableProperty] private bool relayOnly;
[ObservableProperty] private string transportStatus = "尚未建立数据通道";
@@ -300,7 +300,7 @@ public partial class MainViewModel : ObservableObject, IDisposable
int? usbPort = null;
if (UsbMode) {
usbPort = ConnectionPorts.Allocate(UsbPort, reserved);
WindowsUsbSession.Validate(UsbipPath, usbPort.Value);
UsbSession.Validate(UsbipPath, usbPort.Value);
}
if (sessions.Remove(device.Id, out var old)) { old.PropertyChanged -= ConnectionChanged; old.Dispose(); }
var session = new DeviceConnection(device.Id,