diff --git a/src/libs/Controller/USBController.cs b/src/libs/Controller/USBController.cs index 7d27d12..2fa2fe8 100644 --- a/src/libs/Controller/USBController.cs +++ b/src/libs/Controller/USBController.cs @@ -37,8 +37,11 @@ public enum USBProductID : int // EVGA CLC CLC = 0xb200, - // NZXT RGB & Fan Controller + // NZXT RGB & Fan Controller V1 RGBAndFanController = 0x2009, + + // NZXT RGB & Fan Controller V2 / Smart Device V2 + RGBAndFanControllerV2 = 0x2019, } public class USBController diff --git a/src/libs/Hardware/HardwareManager.cs b/src/libs/Hardware/HardwareManager.cs index c3aa996..ea10353 100644 --- a/src/libs/Hardware/HardwareManager.cs +++ b/src/libs/Hardware/HardwareManager.cs @@ -516,26 +516,36 @@ public void start() var fanDevice = new HardwareDevice("NZXT RGB & Fan Controller"); var controlDevice = new HardwareDevice("NZXT RGB & Fan Controller"); uint num = 1; - uint devCount = HidUSBController.getDeviceCount(USBVendorID.NZXT, USBProductID.RGBAndFanController); - for (uint i = 0; i < devCount; i++) + + // Support both V1 (0x2009) and V2 (0x2019) RGB & Fan Controllers + USBProductID[] supportedProductIDs = { + USBProductID.RGBAndFanController, // V1 device + USBProductID.RGBAndFanControllerV2 // V2 / Smart Device V2 + }; + + foreach (var productID in supportedProductIDs) { - var rgb = new RGBnFC(); - if (rgb.start(i) == true) + uint devCount = HidUSBController.getDeviceCount(USBVendorID.NZXT, productID); + for (uint i = 0; i < devCount; i++) { - RGBnFCList.Add(rgb); - - for (int j = 0; j < RGBnFC.MAX_FAN_COUNT; j++) + var rgb = new RGBnFC(); + if (rgb.start(i, productID) == true) { - var id = string.Format("NZXT/RGBnFC/{0}/Fan/{1}", i, j); - var fan = new RGBnFCFanSpeed(id, rgb, j, num); - fanDevice.addDevice(fan); + RGBnFCList.Add(rgb); - id = string.Format("NZXT/RGBnFC/{0}/Control/{1}", i, j); - var control = new RGBnFCControl(id, rgb, j, num); - controlDevice.addDevice(control); - this.addChangeValue(control.getMinSpeed(), control, false); + for (int j = 0; j < RGBnFC.MAX_FAN_COUNT; j++) + { + var id = string.Format("NZXT/RGBnFC/{0}/Fan/{1}", i, j); + var fan = new RGBnFCFanSpeed(id, rgb, j, num); + fanDevice.addDevice(fan); - num++; + id = string.Format("NZXT/RGBnFC/{0}/Control/{1}", i, j); + var control = new RGBnFCControl(id, rgb, j, num); + controlDevice.addDevice(control); + this.addChangeValue(control.getMinSpeed(), control, false); + + num++; + } } } } diff --git a/src/libs/Hardware/RGBnFC.cs b/src/libs/Hardware/RGBnFC.cs index cca3d48..98dee1a 100644 --- a/src/libs/Hardware/RGBnFC.cs +++ b/src/libs/Hardware/RGBnFC.cs @@ -33,7 +33,7 @@ public RGBnFC() : base(USBDeviceType.RGBnFC) } } - public bool start(uint index) + public bool start(uint index, USBProductID productID) { Monitor.Enter(mLock); @@ -46,7 +46,8 @@ public bool start(uint index) mFileName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\" + string.Format("RGBnFC{0}.json", index + 1); } - mUSBController = new HidUSBController(USBVendorID.NZXT, USBProductID.RGBAndFanController); + // Support both V1 (0x2009) and V2 (0x2019) devices + mUSBController = new HidUSBController(USBVendorID.NZXT, productID); mUSBController.onRecvHandler += onRecv; if (mUSBController.start(index) == false) {