Exemple #1
0
        public void ControlTransfer(byte requestType, byte request, ushort val, ushort index, byte[] data, uint timeout)
        {
            ushort len = 0;

            if (data != null)
            {
                len = (ushort)data.Length;
            }

            Internal.Constants.LibUSBError retval = Internal.Methods.libusb_control_transfer(mvarHandle, requestType,
                                                                                             request, val, index, data, len, timeout);
            Internal.Methods.libusb_error_to_exception(retval);
        }
Exemple #2
0
 public UsbContext()
 {
     Internal.Constants.LibUSBError retval = Internal.Methods.libusb_init(ref mvarHandle);
 }
Exemple #3
0
 public void AttachKernelDriver(int interfaceNumber)
 {
     Internal.Constants.LibUSBError retval = Internal.Methods.libusb_attach_kernel_driver(mvarHandle, interfaceNumber);
     Internal.Methods.libusb_error_to_exception(retval);
 }
Exemple #4
0
 public void ReleaseInterface(int intf)
 {
     Internal.Constants.LibUSBError v = Internal.Methods.libusb_release_interface(mvarHandle, intf);
     Internal.Methods.libusb_error_to_exception(v);
 }
Exemple #5
0
 public void SetConfiguration(int configuration)
 {
     Internal.Constants.LibUSBError v = Internal.Methods.libusb_set_configuration(mvarHandle, configuration);
     Internal.Methods.libusb_error_to_exception(v);
 }
Exemple #6
0
 public void BulkTransfer(byte endpoint, byte[] data, out int actualLength, uint timeout)
 {
     actualLength = 0;
     Internal.Constants.LibUSBError retval = Internal.Methods.libusb_bulk_transfer(mvarHandle, endpoint, data, data.Length, ref actualLength, timeout);
     Internal.Methods.libusb_error_to_exception(retval);
 }