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 1ccaadd5d0
commit 9bb2a4e693
197 changed files with 4481 additions and 4332 deletions

View File

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