mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-01-21 21:47:54 -05:00
Move HID detector calls to RunHIDDetector/RunHIDWrappedDetector functions and return controller list from detector functions
This commit is contained in:
@@ -10,8 +10,8 @@
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <hidapi.h>
|
||||
#include "DetectionManager.h"
|
||||
#include "AMDWraithPrismController.h"
|
||||
#include "DetectionManager.h"
|
||||
#include "RGBController_AMDWraithPrism.h"
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
@@ -24,25 +24,22 @@
|
||||
\*---------------------------------------------------------*/
|
||||
#define AMD_WRAITH_PRISM_PID 0x0051
|
||||
|
||||
/******************************************************************************************\
|
||||
* *
|
||||
* DetectAMDWraithPrismControllers *
|
||||
* *
|
||||
* Tests the USB address to see if an AMD Wraith Prism controller exists there. *
|
||||
* *
|
||||
\******************************************************************************************/
|
||||
|
||||
void DetectAMDWraithPrismControllers(hid_device_info* info, const std::string&)
|
||||
DetectedControllers DetectAMDWraithPrismControllers(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)
|
||||
{
|
||||
AMDWraithPrismController* controller = new AMDWraithPrismController(dev, info->path);
|
||||
RGBController_AMDWraithPrism* rgb_controller = new RGBController_AMDWraithPrism(controller);
|
||||
|
||||
DetectionManager::get()->RegisterRGBController(rgb_controller);
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
REGISTER_HID_DETECTOR_IP("AMD Wraith Prism", DetectAMDWraithPrismControllers, AMD_WRAITH_PRISM_VID, AMD_WRAITH_PRISM_PID, 1, 0xFF00);
|
||||
|
||||
Reference in New Issue
Block a user