mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-10-21 08:05:03 -04:00
Consolidate Corsair Lighting Node and compatible device drivers
This commit is contained in:
1 parent
bc01ec0e4b
commit
1115213d5a
3 files changed
+43
-13
No files matched your search
@@ -86,7 +86,7 @@ class CorsairNodeProController
|
||||
public:
|
||||
CorsairNodeProController(libusb_device_handle* dev_handle);
|
||||
~CorsairNodeProController();
|
||||
|
||||
|
||||
unsigned int GetStripsOnChannel(unsigned int channel);
|
||||
|
||||
void SetChannelEffect(unsigned char channel,
|
||||
|
||||
@@ -4,8 +4,33 @@
|
||||
#include <vector>
|
||||
#include <libusb-1.0/libusb.h>
|
||||
|
||||
#define CORSAIR_LIGHTING_NODE_PRO_VID 0x1B1C
|
||||
#define CORSAIR_LIGHTING_NODE_PRO_PID 0x0C0B
|
||||
#define CORSAIR_VID 0x1B1C
|
||||
#define CORSAIR_LIGHTING_NODE_CORE_PID 0x0C1A
|
||||
#define CORSAIR_LIGHTING_NODE_PRO_PID 0x0C0B
|
||||
#define CORSAIR_COMMANDER_PRO_PID 0x0C10
|
||||
#define CORSAIR_LS100_PID 0x0C1E
|
||||
#define CORSAIR_1000D_OBSIDIAN_PID 0x1D00
|
||||
#define CORSAIR_SPEC_OMEGA_RGB_PID 0x1D04
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned short usb_vid;
|
||||
unsigned short usb_pid;
|
||||
unsigned char usb_endpoint;
|
||||
unsigned char channel_count;
|
||||
const char * name;
|
||||
} corsair_node_device;
|
||||
|
||||
static const corsair_node_device device_list[6] =
|
||||
{
|
||||
{ CORSAIR_VID, CORSAIR_LIGHTING_NODE_CORE_PID, 0, 1, "Corsair Lighting Node Core" },
|
||||
{ CORSAIR_VID, CORSAIR_LIGHTING_NODE_PRO_PID, 0, 2, "Corsair Lighting Node Pro" },
|
||||
{ CORSAIR_VID, CORSAIR_COMMANDER_PRO_PID, 2, 2, "Corsair Commander Pro" },
|
||||
{ CORSAIR_VID, CORSAIR_LS100_PID, 0, 1, "Corsair LS100 Lighting Kit" },
|
||||
{ CORSAIR_VID, CORSAIR_1000D_OBSIDIAN_PID, 2, 2, "Corsair 1000D Obsidian" },
|
||||
{ CORSAIR_VID, CORSAIR_SPEC_OMEGA_RGB_PID, 0, 2, "Corsair SPEC OMEGA RGB" }
|
||||
|
||||
};
|
||||
|
||||
/******************************************************************************************\
|
||||
* *
|
||||
@@ -20,18 +45,23 @@ void DetectCorsairNodeProControllers(std::vector<RGBController*> &rgb_controller
|
||||
libusb_context * ctx;
|
||||
libusb_init(&ctx);
|
||||
|
||||
//Look for Corsair Lighting Node Pro
|
||||
libusb_device_handle * dev = libusb_open_device_with_vid_pid(ctx, CORSAIR_LIGHTING_NODE_PRO_VID, CORSAIR_LIGHTING_NODE_PRO_PID);
|
||||
|
||||
if( dev )
|
||||
for(int device_idx = 0; device_idx < 6; device_idx++)
|
||||
{
|
||||
libusb_detach_kernel_driver(dev, 0);
|
||||
libusb_claim_interface(dev, 0);
|
||||
//Look for Corsair Lighting Node Device
|
||||
libusb_device_handle * dev = libusb_open_device_with_vid_pid(ctx, device_list[device_idx].usb_vid, device_list[device_idx].usb_pid);
|
||||
|
||||
CorsairNodeProController* controller = new CorsairNodeProController(dev);
|
||||
if( dev )
|
||||
{
|
||||
libusb_detach_kernel_driver(dev, 0);
|
||||
libusb_claim_interface(dev, 0);
|
||||
|
||||
RGBController_CorsairNodePro* rgb_controller = new RGBController_CorsairNodePro(controller);
|
||||
CorsairNodeProController* controller = new CorsairNodeProController(dev);
|
||||
|
||||
rgb_controllers.push_back(rgb_controller);
|
||||
RGBController_CorsairNodePro* rgb_controller = new RGBController_CorsairNodePro(controller);
|
||||
|
||||
rgb_controller->name = device_list[device_idx].name;
|
||||
|
||||
rgb_controllers.push_back(rgb_controller);
|
||||
}
|
||||
}
|
||||
} /* DetectCorsairNodeProControllers() */
|
||||
@@ -14,7 +14,7 @@ RGBController_CorsairNodePro::RGBController_CorsairNodePro(CorsairNodeProControl
|
||||
{
|
||||
corsair = corsair_ptr;
|
||||
|
||||
name = "Corsair Lighting Node Pro";
|
||||
name = "Corsair Lighting Node Device";
|
||||
|
||||
type = DEVICE_TYPE_LEDSTRIP;
|
||||
|
||||
|
||||
Reference in new issue
Block a user