Beispiel #1
0
 public CUsb(uint nVendor, uint nProductID, uint nReadBuffer, uint nWriteBuffer)
 {
     this.hUsb                = 0U;
     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);
 }
Beispiel #2
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);
     }
 }