39 lines
2.1 KiB
C++
39 lines
2.1 KiB
C++
#include "Detector.h"
|
|
#include "AlienwareAW3423DWFController.h"
|
|
#include "RGBController_AlienwareAW3423DWF.h"
|
|
#include <hidapi.h>
|
|
|
|
/*---------------------------------------------------------*\
|
|
| Alienware Vendor ID |
|
|
\*---------------------------------------------------------*/
|
|
#define ALIENWARE_VID 0x187C
|
|
|
|
/*---------------------------------------------------------*\
|
|
| Alienware Vendor ID |
|
|
\*---------------------------------------------------------*/
|
|
#define ALIENWARE_AW3423DWF_PID 0x100E
|
|
#define ALIENWARE_AW3225QF_PID 0x1013
|
|
#define ALIENWARE_USAGE_PAGE 0xFFDA
|
|
#define ALIENWARE_USAGE 0x00DA
|
|
|
|
/******************************************************************************************\
|
|
* *
|
|
* AlienwareAW3423DWFControllerDetect *
|
|
* *
|
|
* Tests the USB address to see if an Alienware AW3423DWF exists there. *
|
|
* *
|
|
\******************************************************************************************/
|
|
|
|
void DetectAlienwareAW3423DWFControllers(hid_device_info* info, const std::string&)
|
|
{
|
|
hid_device* dev = hid_open_path(info->path);
|
|
if(dev)
|
|
{
|
|
AlienwareAW3423DWFController* controller = new AlienwareAW3423DWFController(dev, info->path);
|
|
RGBController_AlienwareAW3423DWF* rgb_controller = new RGBController_AlienwareAW3423DWF(controller);
|
|
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
|
}
|
|
}
|
|
|
|
REGISTER_HID_DETECTOR("Alienware AW3423DWF", DetectAlienwareAW3423DWFControllers, ALIENWARE_VID, ALIENWARE_AW3423DWF_PID);
|
|
REGISTER_HID_DETECTOR("Alienware AW3225QF", DetectAlienwareAW3423DWFControllers, ALIENWARE_VID, ALIENWARE_AW3225QF_PID);
|