Exemplo n.º 1
0
        public static Task <USBDevice> ReleaseInterface(this USBDevice device, USBInterface usbInterface)
        {
            if (usbInterface == null)
            {
                throw new ArgumentNullException(nameof(usbInterface));
            }

            return(device.ReleaseInterface(usbInterface.InterfaceNumber));
        }
Exemplo n.º 2
0
        public static Task <USBDevice> ReleaseBulkInterface(this USBDevice device)
        {
            var bulkInterface = device.Configuration.Interfaces.FirstOrDefault(i => i.Alternates.Any(a => a.Endpoints.Any(e => e.Type == USBEndpointType.Bulk)));

            if (bulkInterface == null)
            {
                throw new InvalidOperationException("This devices doesn't have a Bulk interface");
            }
            return(device.ReleaseInterface(bulkInterface.InterfaceNumber));
        }