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 7bf9a85bac
commit b76b4b1bd4
196 changed files with 4484 additions and 4349 deletions

View File

@@ -15,27 +15,32 @@
#include "RGBController.h"
#include <hidapi.h>
/*-----------------------------------------------------*\
| ITE Tech vendor ID |
\*-----------------------------------------------------*/
#define ITE_VID 0x048D
/*---------------------------------------------------------*\
| ITE Tech vendor ID |
\*---------------------------------------------------------*/
#define ITE_VID 0x048D
/*-----------------------------------------------------*\
| CLEVO Lightbar product ID |
\*-----------------------------------------------------*/
#define CLEVO_LIGHTBAR_PID 0x7001
/*---------------------------------------------------------*\
| CLEVO Lightbar product ID |
\*---------------------------------------------------------*/
#define CLEVO_LIGHTBAR_PID 0x7001
void DetectClevoLightbarControllers(hid_device_info* info, const std::string& name)
DetectedControllers DetectClevoLightbarControllers(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)
{
ClevoLightbarController* controller = new ClevoLightbarController(dev, *info);
RGBController_ClevoLightbar* rgb_controller = new RGBController_ClevoLightbar(controller);
DetectionManager::get()->RegisterRGBController(rgb_controller);
detected_controllers.push_back(rgb_controller);
}
return(detected_controllers);
}
REGISTER_HID_DETECTOR_PU("CLEVO Lightbar", DetectClevoLightbarControllers, ITE_VID, CLEVO_LIGHTBAR_PID, 0xFF03, 0x02);