Files
OpenRGB/Controllers/ThingMController/ThingMControllerDetect.cpp
Chris 3095572260 Adjusting HID detection to fix false positives
* Adjusting Interface for Razer Chroma
* Adjusting Interface for ThingMBlink

Commit amended for code style by Adam Honse <calcprogrammer1@gmail.com>
2021-11-03 22:25:47 -05:00

32 lines
1.5 KiB
C++

#include "Detector.h"
#include "BlinkController.h"
#include "RGBController.h"
#include "RGBController_BlinkController.h"
#include <hidapi/hidapi.h>
#define THINGM_VID 0x27B8
#define THINGM_BLINK_PID 0x01ED
/******************************************************************************************\
* *
* DetectThingMControllers *
* *
* Tests the USB address to see if any CoolerMaster controllers exists there. *
* *
\******************************************************************************************/
void DetectThingMBlink(hid_device_info* info, const std::string&)
{
hid_device* dev = hid_open_path(info->path);
if(dev)
{
BlinkController* controller = new BlinkController(dev, info->path);
RGBController_BlinkController* rgb_controller = new RGBController_BlinkController(controller);
// Constructor sets the name
ResourceManager::get()->RegisterRGBController(rgb_controller);
}
}
REGISTER_HID_DETECTOR_PU("ThingM blink(1) mk2", DetectThingMBlink, THINGM_VID, THINGM_BLINK_PID, 0xFF00, 0x01);