UsbIOSync() static private méthode

static private UsbIOSync ( SafeHandle dev, int code, Object inBuffer, int inSize, IntPtr outBuffer, int outSize, int &ret ) : bool
dev System.Runtime.InteropServices.SafeHandle
code int
inBuffer Object
inSize int
outBuffer System.IntPtr
outSize int
ret int
Résultat bool
Exemple #1
0
        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));
        }
Exemple #2
0
        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));
        }
Exemple #3
0
        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));
        }