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 16fda5d1d3
commit bd1aee699d
196 changed files with 4484 additions and 4349 deletions

View File

@@ -10,8 +10,8 @@
\*---------------------------------------------------------*/
#include <hidapi.h>
#include "DetectionManager.h"
#include "CorsairLightingNodeController.h"
#include "DetectionManager.h"
#include "RGBController_CorsairLightingNode.h"
#define CORSAIR_VID 0x1B1C
@@ -23,26 +23,23 @@
#define CORSAIR_SPEC_OMEGA_RGB_PID 0x1D04
#define CORSAIR_LT100_PID 0x0C23
/******************************************************************************************\
* *
* DetectCorsairLightingNodeControllers *
* *
* Detect devices supported by the Corsair Lighting Node Pro driver *
* *
\******************************************************************************************/
void DetectCorsairLightingNodeControllers(hid_device_info* info, const std::string& name)
DetectedControllers DetectCorsairLightingNodeControllers(hid_device_info* info, const std::string& name)
{
hid_device* dev = hid_open_path(info->path);
DetectedControllers detected_controllers;
hid_device* dev;
dev = hid_open_path(info->path);
if(dev)
{
CorsairLightingNodeController* controller = new CorsairLightingNodeController(dev, info->path, name);
RGBController_CorsairLightingNode* rgb_controller = new RGBController_CorsairLightingNode(controller);
DetectionManager::get()->RegisterRGBController(rgb_controller);
detected_controllers.push_back(rgb_controller);
}
} /* DetectCorsairLightingNodeControllers() */
return(detected_controllers);
}
REGISTER_HID_DETECTOR("Corsair Lighting Node Core", DetectCorsairLightingNodeControllers, CORSAIR_VID, CORSAIR_LIGHTING_NODE_CORE_PID); // 1 channel
REGISTER_HID_DETECTOR("Corsair Lighting Node Pro", DetectCorsairLightingNodeControllers, CORSAIR_VID, CORSAIR_LIGHTING_NODE_PRO_PID); // 2 channels