mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-01-22 05:57:53 -05:00
Move HID detector calls to RunHIDDetector/RunHIDWrappedDetector functions and return controller list from detector functions
This commit is contained in:
@@ -20,25 +20,23 @@
|
||||
#define TECKNET_M0008_U 0x01 //Usage 01
|
||||
#define TECKNET_M0008_UPG 0xFFA0 //Vendor Defined Usage Page
|
||||
|
||||
/******************************************************************************************\
|
||||
* *
|
||||
* DetectTecknetControllers *
|
||||
* *
|
||||
* Tests the USB address to see if any Tecknet Controllers. *
|
||||
* *
|
||||
\******************************************************************************************/
|
||||
|
||||
void DetectTecknetControllers(hid_device_info* info, const std::string&)
|
||||
DetectedControllers DetectTecknetControllers(hid_device_info* info, const std::string&)
|
||||
{
|
||||
hid_device* dev = hid_open_path(info->path);
|
||||
DetectedControllers detected_controllers;
|
||||
hid_device* dev;
|
||||
|
||||
dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
TecknetController* controller = new TecknetController(dev, info->path);
|
||||
TecknetController* controller = new TecknetController(dev, info->path);
|
||||
RGBController_Tecknet* rgb_controller = new RGBController_Tecknet(controller);
|
||||
// Constructor sets the name
|
||||
DetectionManager::get()->RegisterRGBController(rgb_controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
} /* DetectTecknetControllers) */
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
#ifdef USE_HID_USAGE
|
||||
REGISTER_HID_DETECTOR_PU("Tecknet M008", DetectTecknetControllers, TECKNET_VID, TECKNET_M0008_PID, TECKNET_M0008_UPG, TECKNET_M0008_U);
|
||||
|
||||
Reference in New Issue
Block a user