OpenRGB/Controllers/ThermaltakePoseidonZRGBController/ThermaltakePoseidonZRGBControllerDetect.cpp
k1-801 dc2b41a0e2 Massive HID detectors update
Commit amended to undo change to device list management, still working through that merge request.  Want to work this one in first.  Changes by Adam Honse <calcprogrammer1@gmail.com>
2020-11-25 02:17:18 -06:00

32 lines
1.6 KiB
C++

#include "Detector.h"
#include "ThermaltakePoseidonZRGBController.h"
#include "RGBController.h"
#include "RGBController_ThermaltakePoseidonZRGB.h"
#include <vector>
#include <hidapi/hidapi.h>
#define TT_POSEIDON_Z_RGB_VID 0x264A
#define TT_POSEIDON_Z_RGB_PID 0x3006
/******************************************************************************************\
* *
* DetectPoseidonZRGBControllers *
* *
* Tests the USB address to see if a Thermaltake Poseidon Z RGB Keyboard controller *
* exists there. *
* *
\******************************************************************************************/
void DetectPoseidonZRGBControllers(hid_device_info* info, const std::string&)
{
hid_device* dev = hid_open_path(info->path);
if( dev )
{
PoseidonZRGBController* controller = new PoseidonZRGBController(dev, info->path);
RGBController_PoseidonZRGB* rgb_controller = new RGBController_PoseidonZRGB(controller);
// Constructor sets the name
ResourceManager::get()->RegisterRGBController(rgb_controller);
}
} /* DetectPoseidonZRGBControllers() */
REGISTER_HID_DETECTOR_IP("Thermaltake Poseidon Z RGB", DetectPoseidonZRGBControllers, TT_POSEIDON_Z_RGB_VID, TT_POSEIDON_Z_RGB_PID, 1, 0xFF01);