Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        // 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));
        }