Esempio n. 1
0
 public CUsb(uint nVendor, uint nProductID, uint nReadBuffer, uint nWriteBuffer, int option)
 {
     this.hUsb = 0U;
     if (option == 0)
     {
         this.hUsb                = CUsb.USBOpen(this.hUsb, nVendor, nProductID, nReadBuffer, nWriteBuffer, (CUsb.UsbEventHandler)null);
         this.eventTimer          = new Timer();
         this.eventTimer.Interval = 50;
         this.eventTimer.Enabled  = true;
         this.eventTimer.Tick    += new EventHandler(this.eventTimer_Tick);
     }
     else
     {
         CUsb.UsbEventHandler USBProc = new CUsb.UsbEventHandler(this._UsbEvent);
         this.hUsb = CUsb.USBOpen(this.hUsb, nVendor, nProductID, nReadBuffer, nWriteBuffer, USBProc);
     }
 }
Esempio n. 2
0
 private static extern uint USBOpen(uint hUsb, uint nVendor, uint nProductID, uint nReadBuffer, uint nWriteBuffer, CUsb.UsbEventHandler USBProc);