protected HIDTransportBase(IHIDDevice device, UsageSpecification[] acceptedUsageSpecifications)
        {
            _Device = device ?? throw new ArgumentNullException(nameof(device));

            _VendorProductIds            = new VendorProductIds(device.VendorId, device.ProductId);
            _AcceptedUsageSpecifications = acceptedUsageSpecifications;
        }
 protected HIDTransportBase(HidDevice device, UsageSpecification[] acceptedUsageSpecifications)
 {
     if (!device.IsOpen)
     {
         device.OpenDevice();
     }
     _Device                      = device;
     _DevicePath                  = device.DevicePath;
     _VendorProductIds            = new VendorProductIds(device.Attributes.VendorId, device.Attributes.ProductId);
     _AcceptedUsageSpecifications = acceptedUsageSpecifications;
     ReadTimeout                  = TimeSpan.FromMilliseconds(DEFAULT_TIMEOUT);
 }
예제 #3
-1
 protected HIDTransportBase(HidDevice device, UsageSpecification[] acceptedUsageSpecifications)
 {
     if(!device.IsOpen)
         device.OpenDevice();
     _Device = device;
     _DevicePath = device.DevicePath;
     _VendorProductIds = new VendorProductIds(device.Attributes.VendorId, device.Attributes.ProductId);
     _AcceptedUsageSpecifications = acceptedUsageSpecifications;
     ReadTimeout = TimeSpan.FromMilliseconds(DEFAULT_TIMEOUT);
 }