示例#1
0
 public void UsbPipeTransferAsync(bool fRead, DWORD dwOptions,
                                  byte[] buffer, DWORD dwBuffSize, DWORD timeOut,
                                  D_USER_TRANSFER_COMPLETION TransferCompletion)
 {
     m_fRead              = fRead;
     m_dwOptions          = dwOptions;
     m_buffer             = buffer;
     m_dwBuffSize         = dwBuffSize;
     m_SetupPacket        = null;
     m_timeOut            = timeOut;
     m_TransferCompletion = TransferCompletion;
     m_fInUse             = true;
     m_transThread        = new Thread(new ThreadStart(AsyncTransfer));
     m_transThread.Start();
 }
示例#2
0
        public void UsbPipeTransferAsync(bool fRead, DWORD dwOptions,
                                         DWORD timeOut, D_USER_TRANSFER_COMPLETION TransferCompletion)
        {
            m_fRead              = fRead;
            m_dwOptions          = dwOptions;
            m_timeOut            = timeOut;
            m_TransferCompletion = TransferCompletion;

            m_dwBuffSize = (DWORD)((m_pPipe.type !=
                                    (DWORD)USB_PIPE_TYPE.PIPE_TYPE_ISOCHRONOUS)?
                                   m_pPipe.dwMaximumPacketSize : m_pPipe.dwMaximumPacketSize * 8);
            m_buffer = new byte[m_dwBuffSize];

            m_SetupPacket = null;
            m_fInUse      = true;
            m_transThread = new Thread(new ThreadStart(AsyncTransfer));
            m_transThread.Start();
        }