mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-10-30 04:21:08 -04:00
Convert NZXTHuePlusController to use USB Serial detector
This commit is contained in:
1 parent
c907bfdc20
commit
d0d2bfb553
3 files changed
+10
-20
No files matched your search
@@ -27,7 +27,7 @@ HuePlusController::~HuePlusController()
|
||||
delete serialport;
|
||||
}
|
||||
|
||||
void HuePlusController::Initialize(char* port)
|
||||
void HuePlusController::Initialize(std::string port)
|
||||
{
|
||||
port_name = port;
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ public:
|
||||
HuePlusController();
|
||||
~HuePlusController();
|
||||
|
||||
void Initialize(char* port);
|
||||
void Initialize(std::string port);
|
||||
std::string GetLocation();
|
||||
unsigned int GetLEDsOnChannel(unsigned int channel);
|
||||
|
||||
|
||||
@@ -11,37 +11,27 @@
|
||||
|
||||
#include <vector>
|
||||
#include "DetectionManager.h"
|
||||
#include "find_usb_serial_port.h"
|
||||
#include "NZXTHuePlusController.h"
|
||||
#include "RGBController_NZXTHuePlus.h"
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| NZXT USB IDs |
|
||||
\*---------------------------------------------------------*/
|
||||
#define NZXT_HUE_PLUS_VID 0x04D8
|
||||
#define NZXT_HUE_PLUS_PID 0x00DF
|
||||
#define NZXT_HUE_PLUS_VID 0x04D8
|
||||
#define NZXT_HUE_PLUS_PID 0x00DF
|
||||
|
||||
DetectedControllers DetectNZXTHuePlusControllers()
|
||||
DetectedControllers DetectNZXTHuePlusControllers(SerialDeviceInfo* port_info, const std::string& name)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
std::vector<std::string> ports;
|
||||
|
||||
ports = find_usb_serial_port(NZXT_HUE_PLUS_VID, NZXT_HUE_PLUS_PID);
|
||||
HuePlusController* controller = new HuePlusController();
|
||||
controller->Initialize(port_info->port_path);
|
||||
|
||||
for(std::size_t i = 0; i < ports.size(); i++)
|
||||
{
|
||||
if(ports[i] != "")
|
||||
{
|
||||
HuePlusController* controller = new HuePlusController();
|
||||
controller->Initialize((char *)ports[i].c_str());
|
||||
RGBController_HuePlus* rgb_controller = new RGBController_HuePlus(controller);
|
||||
RGBController_HuePlus* rgb_controller = new RGBController_HuePlus(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
}
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
REGISTER_DETECTOR("NZXT Hue+", DetectNZXTHuePlusControllers);
|
||||
REGISTER_CUSTOM_UDEV_RULE(nzxt_hue_plus, "NZXT Hue+", "SUBSYSTEMS==\"serial|hidraw\", ATTRS{idVendor}==\"04d8\", ATTRS{idProduct}==\"00df\", TAG+=\"uaccess\", TAG+=\"NZXT_Hue\"");
|
||||
REGISTER_USB_SERIAL_DETECTOR("NZXT Hue+", DetectNZXTHuePlusControllers, NZXT_HUE_PLUS_VID, NZXT_HUE_PLUS_PID);
|
||||
Reference in new issue
Block a user