mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2025-12-24 07:47:49 -05:00
41 lines
1.7 KiB
C++
41 lines
1.7 KiB
C++
/*---------------------------------------------------------*\
|
|
| LuxaforControllerDetect.cpp |
|
|
| |
|
|
| Detector for Luxafor devices |
|
|
| |
|
|
| Adam Honse (calcprogrammer1@gmail.com) 05 Sep 2024 |
|
|
| |
|
|
| This file is part of the OpenRGB project |
|
|
| SPDX-License-Identifier: GPL-2.0-only |
|
|
\*---------------------------------------------------------*/
|
|
|
|
#include "Detector.h"
|
|
#include "LuxaforController.h"
|
|
#include "RGBController_Luxafor.h"
|
|
|
|
/*---------------------------------------------------------*\
|
|
| Luxafor USB Vendor ID |
|
|
\*---------------------------------------------------------*/
|
|
#define LUXAFOR_VID 0x04D8
|
|
|
|
/*---------------------------------------------------------*\
|
|
| Luxafor USB Product ID |
|
|
\*---------------------------------------------------------*/
|
|
#define LUXAFOR_FLAG_PID 0xF372
|
|
|
|
void DetectLuxaforControllers(hid_device_info* info, const std::string& name)
|
|
{
|
|
hid_device* dev = hid_open_path(info->path);
|
|
|
|
if(dev)
|
|
{
|
|
LuxaforController* controller = new LuxaforController(dev, info->path);
|
|
RGBController_Luxafor* rgb_controller = new RGBController_Luxafor(controller);
|
|
rgb_controller->name = name;
|
|
|
|
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
|
}
|
|
}
|
|
|
|
REGISTER_HID_DETECTOR( "Luxafor Flag", DetectLuxaforControllers, LUXAFOR_VID, LUXAFOR_FLAG_PID );
|