Initial commit of Luxafor Flag controller, only supports direct mode for now

This commit is contained in:
Adam Honse
2024-09-05 22:18:24 -05:00
parent a675825224
commit ae826f2fd0
5 changed files with 363 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
/*---------------------------------------------------------*\
| 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 );