Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/libs/Controller/USBController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
40 changes: 25 additions & 15 deletions src/libs/Hardware/HardwareManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
}
}
}
}
Expand Down
5 changes: 3 additions & 2 deletions src/libs/Hardware/RGBnFC.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public RGBnFC() : base(USBDeviceType.RGBnFC)
}
}

public bool start(uint index)
public bool start(uint index, USBProductID productID)
{
Monitor.Enter(mLock);

Expand All @@ -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)
{
Expand Down