mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-01-22 05:57:53 -05:00
Move HID detector calls to RunHIDDetector/RunHIDWrappedDetector functions and return controller list from detector functions
This commit is contained in:
@@ -17,25 +17,22 @@
|
||||
#define EK_VID 0x0483
|
||||
#define EK_LOOP_CONNECT 0x5750
|
||||
|
||||
/******************************************************************************************\
|
||||
* *
|
||||
* DetectEKControllers *
|
||||
* *
|
||||
* Tests the USB address to see if any EK Controllers exists there. *
|
||||
* *
|
||||
\******************************************************************************************/
|
||||
|
||||
void DetectEKControllers(hid_device_info* info, const std::string&)
|
||||
DetectedControllers DetectEKControllers(hid_device_info* info, const std::string&)
|
||||
{
|
||||
hid_device* dev = hid_open_path(info->path);
|
||||
DetectedControllers detected_controllers;
|
||||
hid_device* dev;
|
||||
|
||||
dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
EKController* controller = new EKController(dev, info->path);
|
||||
RGBController_EKController* rgb_controller = new RGBController_EKController(controller);
|
||||
// Constructor sets the name
|
||||
DetectionManager::get()->RegisterRGBController(rgb_controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
} /* DetectEKControllers() */
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
REGISTER_HID_DETECTOR_IPU("EK Loop Connect", DetectEKControllers, EK_VID, EK_LOOP_CONNECT, 0, 0xFFA0, 1);
|
||||
|
||||
Reference in New Issue
Block a user