mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-01-31 10:21:10 -05:00
Move HID detector calls to RunHIDDetector/RunHIDWrappedDetector functions and return controller list from detector functions
This commit is contained in:
@@ -9,29 +9,27 @@
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "DetectionManager.h"
|
||||
#include "XPGSummonerController.h"
|
||||
#include "RGBController_XPGSummoner.h"
|
||||
#include <hidapi.h>
|
||||
#include "DetectionManager.h"
|
||||
#include "RGBController_XPGSummoner.h"
|
||||
#include "XPGSummonerController.h"
|
||||
|
||||
/******************************************************************************************\
|
||||
* *
|
||||
* DetectXPGSummonerControllers *
|
||||
* *
|
||||
* Tests the USB address to see if a XPG Summoner Keyboard controller exists there. *
|
||||
* *
|
||||
\******************************************************************************************/
|
||||
|
||||
void DetectXPGSummonerControllers(hid_device_info *info, const std::string &name)
|
||||
DetectedControllers DetectXPGSummonerControllers(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)
|
||||
{
|
||||
XPGSummonerController *controller = new XPGSummonerController(dev, info->path, info->product_id, name);
|
||||
RGBController_XPGSummoner *rgb_controller = new RGBController_XPGSummoner(controller);
|
||||
DetectionManager::get()->RegisterRGBController(rgb_controller);
|
||||
XPGSummonerController* controller = new XPGSummonerController(dev, info->path, info->product_id, name);
|
||||
RGBController_XPGSummoner* rgb_controller = new RGBController_XPGSummoner(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
} /* DetectXPGSummonerControllers() */
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
REGISTER_HID_DETECTOR_IPU("XPG Summoner Gaming Keyboard", DetectXPGSummonerControllers, XPG_VID, XPG_SUMMONER_PID, 2, 0xFF01, 0x0001);
|
||||
|
||||
Reference in New Issue
Block a user