mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-05-19 03:56:26 -04:00
Move HID detector calls to RunHIDDetector/RunHIDWrappedDetector functions and return controller list from detector functions
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user