Move HID detector calls to RunHIDDetector/RunHIDWrappedDetector functions and return controller list from detector functions

This commit is contained in:
Adam Honse
2026-01-12 19:05:21 -06:00
parent c46540339a
commit 8f29ad126e
191 changed files with 4362 additions and 4242 deletions

View File

@@ -7,8 +7,8 @@
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#include "DetectionManager.h"
#include "AlienwareController.h"
#include "DetectionManager.h"
#include "RGBController_Alienware.h"
/*---------------------------------------------------------*\
@@ -22,17 +22,22 @@
#define ALIENWARE_G_SERIES_PID1 0x0550
#define ALIENWARE_G_SERIES_PID2 0x0551
void DetectAlienwareControllers(hid_device_info* info, const std::string& name)
DetectedControllers DetectAlienwareControllers(hid_device_info* info, const std::string& name)
{
hid_device* dev = hid_open_path(info->path);
DetectedControllers detected_controllers;
hid_device* dev;
dev = hid_open_path(info->path);
if(dev)
{
AlienwareController* controller = new AlienwareController(dev, *info, name);
RGBController_Alienware* rgb_controller = new RGBController_Alienware(controller);
DetectionManager::get()->RegisterRGBController(rgb_controller);
detected_controllers.push_back(rgb_controller);
}
return(detected_controllers);
}
REGISTER_HID_DETECTOR("Dell G Series LED Controller", DetectAlienwareControllers, ALIENWARE_VID, ALIENWARE_G_SERIES_PID1);