mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-01-25 15:37:58 -05:00
Move HID detector calls to RunHIDDetector/RunHIDWrappedDetector functions and return controller list from detector functions
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user