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 1ccaadd5d0
commit 9bb2a4e693
197 changed files with 4481 additions and 4332 deletions

View File

@@ -9,33 +9,38 @@
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#include "Detector.h"
#include "DetectionManager.h"
#include "ClevoLightbarController.h"
#include "RGBController_ClevoLightbar.h"
#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);
ResourceManager::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);