public static void CreateUSBIPServer(this Emulation emulation, int port = 3240, string address = "127.0.0.1", string name = "usb") { var server = new USBIPServer(address, port); server.Run(); emulation.HostMachine.AddHostMachineElement(server, name); }
// this is just a simple wrapper method allowing to register devices from monitor public static void Register(this USBIPServer @this, IUSBDevice device, int?port = null) { if (!port.HasValue) { port = @this.Children.Any() ? @this.Children.Max(x => x.RegistrationPoint.Address) + 1 : 0; } @this.Register(device, new NumberRegistrationPoint <int>(port.Value)); }