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

This commit is contained in:
Adam Honse committed 2026-05-05 01:37:26 -05:00
1 parent 18138c1527
commit b19e65cd2d
196 files changed
+4467 -4302

No files matched your search

@@ -8,38 +8,31 @@
\*---------------------------------------------------------*/
#include <hidapi.h>
#include <sstream>
#include <iomanip>
#include <string>
#include "DetectionManager.h"
#include "LaviewTechnologyController.h"
#include "RGBController.h"
#include "RGBController_LaviewTechnology.h"
#include "LogManager.h"
#define LAVIEW_TECHNOLOGY_VID 0x22D4
#define GLORIOUS_MODEL_I_PID 0x1503 // Wired
/******************************************************************************************\
* *
* DetectLaviewTechnologyMouse *
* *
* Tests the USB address to see if a Laview Technology controller exists there. *
* *
\******************************************************************************************/
static void DetectLaviewTechnologyMouse(hid_device_info* info, const std::string& name)
DetectedControllers DetectLaviewTechnologyMouse(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)
{
LaviewTechnologyController* controller = new LaviewTechnologyController(dev, info, name);
RGBController_LaviewTechnology* rgb_controller = new RGBController_LaviewTechnology(controller);
DetectionManager::get()->RegisterRGBController(rgb_controller);
detected_controllers.push_back(rgb_controller);
}
return(detected_controllers);
}
REGISTER_HID_DETECTOR_IPU("Glorious Model I", DetectLaviewTechnologyMouse, LAVIEW_TECHNOLOGY_VID, GLORIOUS_MODEL_I_PID, 1, 0xFF01, 0x02);