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

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