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:
@@ -9,8 +9,8 @@
|
||||
|
||||
#include <hidapi.h>
|
||||
#include "DetectionManager.h"
|
||||
#include "WushiL50USBController.h"
|
||||
#include "RGBController_WushiL50USB.h"
|
||||
#include "WushiL50USBController.h"
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Wushi vendor ID |
|
||||
@@ -22,17 +22,22 @@
|
||||
\*-----------------------------------------------------*/
|
||||
#define WUSHI_PID 0x1234
|
||||
|
||||
void DetectWushiL50USBControllers(hidapi_wrapper wrapper, hid_device_info* info, const std::string& name)
|
||||
DetectedControllers DetectWushiL50USBControllers(hidapi_wrapper wrapper, hid_device_info* info, const std::string& name)
|
||||
{
|
||||
hid_device* dev = wrapper.hid_open_path(info->path);
|
||||
DetectedControllers detected_controllers;
|
||||
hid_device* dev;
|
||||
|
||||
dev = wrapper.hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
WushiL50USBController* controller = new WushiL50USBController(wrapper, dev, info->path, name);
|
||||
RGBController_WushiL50USB* rgb_controller = new RGBController_WushiL50USB(controller);
|
||||
|
||||
DetectionManager::get()->RegisterRGBController(rgb_controller);
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
REGISTER_HID_WRAPPED_DETECTOR("JSAUX RGB Docking Station", DetectWushiL50USBControllers, WUSHI_VID, WUSHI_PID);
|
||||
|
||||
Reference in New Issue
Block a user