public override bool start(USBProductID productID) { Monitor.Enter(mLock); ProductID = productID; mPumpSpeed = 50; mFanPercent = 25; mLastPumpSpeed = 0; mLastFanPercent = 0; mPumpLastSendTime = 0; mFanLastSendTime = 0; mUSBController = new HidUSBController(USBVendorID.NZXT, ProductID); mUSBController.onRecvHandler += onRecv; if (mUSBController.start() == false) { Monitor.Exit(mLock); this.stop(); return(false); } if (this.readFile() == true) { mIsSendCustomData = (mCustomDataList.Count > 0); } mTimer.Interval = 1000; mTimer.Elapsed += onTimer; mTimer.Start(); Monitor.Exit(mLock); return(true); }
public bool start() { Monitor.Enter(mLock); mUSBController = new HidUSBController(USBVendorID.NZXT, USBProductID.RGBAndFanController); mUSBController.onRecvHandler += onRecv; if (mUSBController.start() == false) { Monitor.Exit(mLock); this.stop(); return(false); } if (this.readFile() == true) { mIsSendCustomData = (mCustomDataList.Count > 0); } // initialize this.initialize(); mTimer.Interval = 1000; mTimer.Elapsed += onTimer; mTimer.Start(); Monitor.Exit(mLock); return(true); }
public override bool start(USBProductID productID) { Monitor.Enter(mLock); var vendorID = USBVendorID.ASETEK; ProductID = productID; // SiUSBController mUSBController = new SiUSBController(vendorID, productID); mUSBController.onRecvHandler += onRecv; if (mUSBController.start() == false) { // WinUSBController mUSBController = new WinUSBController(vendorID, productID, ENDPOINT_IN, ENDPOINT_OUT); mUSBController.onRecvHandler += onRecv; if (mUSBController.start() == false) { Monitor.Exit(mLock); this.stop(); return(false); } } if (this.readFile() == true) { mIsSendCustomData = (mCustomDataList.Count > 0); } mTimer.Interval = 500; mTimer.Elapsed += onTimer; mTimer.Start(); Monitor.Exit(mLock); return(true); }