static private UsbIOSync ( |
||
dev | ||
code | int | |
inBuffer | Object | |
inSize | int | |
outBuffer | ||
outSize | int | |
ret | int | |
Результат | bool |
public bool ResetDevice(SafeHandle interfaceHandle) { LibUsbRequest req = new LibUsbRequest(); int ret; req.Timeout = UsbConstants.DEFAULT_TIMEOUT; return(LibUsbDriverIO.UsbIOSync(interfaceHandle, LibUsbIoCtl.RESET_DEVICE, req, LibUsbRequest.Size, IntPtr.Zero, 0, out ret)); }
public override bool AbortPipe(SafeHandle interfaceHandle, byte pipeID) { LibUsbRequest req = new LibUsbRequest(); int ret; req.Endpoint.ID = pipeID; req.Timeout = UsbConstants.DEFAULT_TIMEOUT; return(LibUsbDriverIO.UsbIOSync(interfaceHandle, LibUsbIoCtl.ABORT_ENDPOINT, req, LibUsbRequest.Size, IntPtr.Zero, 0, out ret)); }
public override bool GetDescriptor(SafeHandle interfaceHandle, byte descriptorType, byte index, ushort languageID, IntPtr buffer, int bufferLength, out int lengthTransferred) { LibUsbRequest req = new LibUsbRequest(); req.Descriptor.Index = index; req.Descriptor.LangID = languageID; req.Descriptor.Recipient = (byte)UsbEndpointDirection.EndpointIn & 0x1F; req.Descriptor.Type = descriptorType; return(LibUsbDriverIO.UsbIOSync(interfaceHandle, LibUsbIoCtl.GET_DESCRIPTOR, req, LibUsbRequest.Size, buffer, bufferLength, out lengthTransferred)); }