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 22a9e3ced2
commit ed62663153
197 changed files with 4481 additions and 4332 deletions

View File

@@ -15,27 +15,24 @@
#include "RGBController_BlinkController.h"
#define THINGM_VID 0x27B8
#define THINGM_BLINK_PID 0x01ED
/******************************************************************************************\
* *
* DetectThingMControllers *
* *
* Tests the USB address to see if any CoolerMaster controllers exists there. *
* *
\******************************************************************************************/
void DetectThingMBlink(hid_device_info* info, const std::string&)
DetectedControllers DetectThingMBlink(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)
{
BlinkController* controller = new BlinkController(dev, info->path);
BlinkController* controller = new BlinkController(dev, info->path);
RGBController_BlinkController* rgb_controller = new RGBController_BlinkController(controller);
// Constructor sets the name
DetectionManager::get()->RegisterRGBController(rgb_controller);
detected_controllers.push_back(rgb_controller);
}
return(detected_controllers);
}
REGISTER_HID_DETECTOR_PU("ThingM blink(1) mk2", DetectThingMBlink, THINGM_VID, THINGM_BLINK_PID, 0xFF00, 0x01);