mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-05-24 22:45:55 -04:00
Move HID detector calls to RunHIDDetector/RunHIDWrappedDetector functions and return controller list from detector functions
This commit is contained in:
@@ -15,25 +15,22 @@
|
||||
#define HP_OMEN_30L_VID 0x103C
|
||||
#define HP_OMEN_30L_PID 0x84FD
|
||||
|
||||
/******************************************************************************************\
|
||||
* *
|
||||
* DetectHPOmen30LController *
|
||||
* *
|
||||
* Tests the USB address to see if an HP Omen 30L controller exists there. *
|
||||
* *
|
||||
\******************************************************************************************/
|
||||
|
||||
void DetectHPOmen30LController(hid_device_info* info, const std::string&)
|
||||
DetectedControllers DetectHPOmen30LController(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)
|
||||
{
|
||||
HPOmen30LController* controller = new HPOmen30LController(dev, info->path);
|
||||
RGBController_HPOmen30L* rgb_controller = new RGBController_HPOmen30L(controller);
|
||||
// Constructor sets the name
|
||||
DetectionManager::get()->RegisterRGBController(rgb_controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
REGISTER_HID_DETECTOR("HP Omen 30L", DetectHPOmen30LController, HP_OMEN_30L_VID, HP_OMEN_30L_PID);
|
||||
|
||||
Reference in New Issue
Block a user