Add ThinkM Blink device controller

Closes #1276
This commit is contained in:
edbgon 2021-10-01 15:41:27 +02:00 committed by Adam Honse
parent 181514ff81
commit 970c8d66cd
7 changed files with 323 additions and 0 deletions

View file

@ -0,0 +1,31 @@
#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_IPU ("ThingM blink(1) mk2", DetectThingMBlink, THINGM_VID, THINGM_BLINK_PID, 1, 0xFF00, 0x01);