rework report id parsing to be more consistent

This commit is contained in:
saad-script
2026-02-02 11:12:26 -05:00
committed by Adam Honse
parent 4a8c083a9c
commit 7c21363830
2 changed files with 96 additions and 34 deletions

View File

@@ -25,10 +25,23 @@ DetectedControllers DetectHIDLampArrayControllers(hid_device_info* info, const s
if(dev)
{
HIDLampArrayController* controller = new HIDLampArrayController(dev, info->path);
RGBController_HIDLampArray* rgb_controller = new RGBController_HIDLampArray(controller);
HIDLampArrayController* controller = new HIDLampArrayController(dev, info->path);
detected_controllers.push_back(rgb_controller);
/*-------------------------------------------------*\
| Only create the RGBController if there are lamps |
| detected in the controller. Otherwise, delete |
| the controller. |
\*-------------------------------------------------*/
if(controller->GetLampCount() > 0)
{
RGBController_HIDLampArray* rgb_controller = new RGBController_HIDLampArray(controller);
detected_controllers.push_back(rgb_controller);
}
else
{
delete controller;
}
}
return(detected_controllers);