OpenRGB/Controllers/GigabyteRGBFusion2USBController/GigabyteRGBFusion2USBControllerDetect.cpp
k1-801 dc2b41a0e2 Massive HID detectors update
Commit amended to undo change to device list management, still working through that merge request.  Want to work this one in first.  Changes by Adam Honse <calcprogrammer1@gmail.com>
2020-11-25 02:17:18 -06:00

33 lines
1.8 KiB
C++

#include "Detector.h"
#include "GigabyteRGBFusion2USBController.h"
#include "RGBController_GigabyteRGBFusion2USB.h"
#include "dependencies/dmiinfo.h"
#define IT8297_VID 0x048D
#define IT8297_IFC 0
#define IT8297_U 0xCC
#define IT8297_UPG 0xFF89
/******************************************************************************************\
* *
* DetectGigabyteRGBFusion2USBControllers *
* *
* Detect GigabyteRGB Fusion 2 devices that use IT8297 RGB controller *
* *
\******************************************************************************************/
void DetectGigabyteRGBFusion2USBControllers(hid_device_info* info, const std::string&)
{
DMIInfo MB_info;
hid_device* dev = hid_open_path(info->path);
if (dev)
{
RGBFusion2USBController * controller = new RGBFusion2USBController(dev, info->path, MB_info.getMainboard());
RGBController_RGBFusion2USB * rgb_controller = new RGBController_RGBFusion2USB(controller);
// Constructor sets the name
ResourceManager::get()->RegisterRGBController(rgb_controller);
}
} /* DetectRGBFusion2USBControllers() */
REGISTER_HID_DETECTOR_IPU("Gigabyte RGB Fusion 2 USB", DetectGigabyteRGBFusion2USBControllers, IT8297_VID, 0x8297, IT8297_IFC, IT8297_UPG, IT8297_U);
REGISTER_HID_DETECTOR_IPU("Gigabyte RGB Fusion 2 USB", DetectGigabyteRGBFusion2USBControllers, IT8297_VID, 0x5702, IT8297_IFC, IT8297_UPG, IT8297_U);