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 c46540339a
commit 8f29ad126e
191 changed files with 4362 additions and 4242 deletions

View File

@@ -20,20 +20,15 @@
#include "RGBController.h"
#include "RGBController_ENESMBus.h"
/******************************************************************************************\
* *
* DetectSpectrixS40GControllers *
* *
* Detects ENE SMBus controllers on XPG Spectrix S40G NVMe devices *
* *
\******************************************************************************************/
void DetectSpectrixS40GControllers()
DetectedControllers DetectSpectrixS40GControllers()
{
/*---------------------------------------------------------------------*\
| Search for /dev/nvmeX nodes with model matching "XPG SPECTRIX S40G" |
\*---------------------------------------------------------------------*/
unsigned int nvme_idx = 0;
DetectedControllers detected_controllers;
/*-----------------------------------------------------*\
| Search for /dev/nvmeX nodes with model matching |
| "XPG SPECTRIX S40G" |
\*-----------------------------------------------------*/
unsigned int nvme_idx = 0;
while(1)
{
@@ -82,12 +77,14 @@ void DetectSpectrixS40GControllers()
ENESMBusController* controller = new ENESMBusController(interface, 0x67, "XPG Spectrix S40G", DEVICE_TYPE_STORAGE);
RGBController_ENESMBus* rgb_controller = new RGBController_ENESMBus(controller);
DetectionManager::get()->RegisterRGBController(rgb_controller);
detected_controllers.push_back(rgb_controller);
}
}
nvme_idx++;
}
} /* DetectSpectrixS40GControllers() */
return(detected_controllers);
}
REGISTER_DETECTOR( "XPG Spectrix S40G", DetectSpectrixS40GControllers);