mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-01-18 20:17:51 -05:00
47 lines
1.6 KiB
C++
47 lines
1.6 KiB
C++
/*---------------------------------------------------------*\
|
|
| SeagateControllerDetect.cpp |
|
|
| |
|
|
| Detector for Seagate |
|
|
| |
|
|
| Adam Honse (CalcProgrammer1) 15 Jun 2023 |
|
|
| |
|
|
| This file is part of the OpenRGB project |
|
|
| SPDX-License-Identifier: GPL-2.0-or-later |
|
|
\*---------------------------------------------------------*/
|
|
|
|
#include "DetectionManager.h"
|
|
#include "RGBController_Seagate.h"
|
|
#include "SeagateController.h"
|
|
#include "scsiapi.h"
|
|
|
|
DetectedControllers DetectSeagateControllers()
|
|
{
|
|
DetectedControllers detected_controllers;
|
|
scsi_device_info * info;
|
|
|
|
info = scsi_enumerate(NULL, NULL);
|
|
|
|
while(info)
|
|
{
|
|
if(strncmp(info->vendor, "Seagate", 7) == 0 && strncmp(info->product, "FireCuda HDD", 12) == 0)
|
|
{
|
|
scsi_device * dev = scsi_open_path(info->path);
|
|
|
|
if(dev)
|
|
{
|
|
SeagateController* controller = new SeagateController(dev, info->path);
|
|
RGBController_Seagate* rgb_controller = new RGBController_Seagate(controller);
|
|
|
|
detected_controllers.push_back(rgb_controller);
|
|
}
|
|
}
|
|
info = info->next;
|
|
}
|
|
|
|
scsi_free_enumeration(info);
|
|
|
|
return(detected_controllers);
|
|
}
|
|
|
|
REGISTER_DETECTOR("Seagate Firecuda HDD", DetectSeagateControllers);
|