mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-07-08 12:25:07 -04:00
Move HID detector calls to RunHIDDetector/RunHIDWrappedDetector functions and return controller list from detector functions
This commit is contained in:
@@ -13,30 +13,25 @@
|
||||
#include "SayoDeviceController.h"
|
||||
#include "RGBController_SayoDevice.h"
|
||||
|
||||
#define SAYO_USB_VID 0x8089
|
||||
#define SAYO_USB_PID_E1 0x0007
|
||||
#define SAYO_USB_VID 0x8089
|
||||
#define SAYO_USB_PID_E1 0x0007
|
||||
|
||||
/*----------------------------------------------------------*\
|
||||
| |
|
||||
| DetectSayoDevice Controller |
|
||||
| |
|
||||
| Detect Sayo Devices |
|
||||
| |
|
||||
\*----------------------------------------------------------*/
|
||||
|
||||
void DetectSayoDeviceController
|
||||
(
|
||||
hid_device_info* info,
|
||||
const std::string& name
|
||||
)
|
||||
DetectedControllers DetectSayoDeviceController(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
hid_device* dev = hid_open_path(info->path);
|
||||
if(dev != nullptr)
|
||||
DetectedControllers detected_controllers;
|
||||
hid_device* dev;
|
||||
|
||||
dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
SayoDeviceController* controller = new SayoDeviceController(dev, info->path, name);
|
||||
RGBController_SayoDevice *rgb_controller = new RGBController_SayoDevice(controller);
|
||||
DetectionManager::get()->RegisterRGBController(rgb_controller);
|
||||
RGBController_SayoDevice* rgb_controller = new RGBController_SayoDevice(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
REGISTER_HID_DETECTOR_PU("SayoDevice E1", DetectSayoDeviceController, SAYO_USB_VID, SAYO_USB_PID_E1, 0xFF11, 0x0002);
|
||||
|
||||
Reference in New Issue
Block a user