Move HID detector calls to RunHIDDetector/RunHIDWrappedDetector functions and return controller list from detector functions

This commit is contained in:
Adam Honse
2026-01-12 19:05:21 -06:00
parent f5558e5d78
commit abade53d77
196 changed files with 4459 additions and 4299 deletions

View File

@@ -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);