mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-04-04 22:24:12 -04:00
Use HID path for Location on Corsair Peripheral controller
This commit is contained in:
@@ -48,9 +48,10 @@ static unsigned int keys_k95[] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07
|
||||
|
||||
static unsigned int st100[] = { 0x00, 0x01, 0x02, 0x03, 0x05, 0x06, 0x07, 0x08, 0x04 };
|
||||
|
||||
CorsairPeripheralController::CorsairPeripheralController(hid_device* dev_handle)
|
||||
CorsairPeripheralController::CorsairPeripheralController(hid_device* dev_handle, const char* path)
|
||||
{
|
||||
dev = dev_handle;
|
||||
dev = dev_handle;
|
||||
location = path;
|
||||
|
||||
ReadFirmwareInfo();
|
||||
|
||||
@@ -67,6 +68,11 @@ device_type CorsairPeripheralController::GetDeviceType()
|
||||
return type;
|
||||
}
|
||||
|
||||
std::string CorsairPeripheralController::GetDeviceLocation()
|
||||
{
|
||||
return(location);
|
||||
}
|
||||
|
||||
int CorsairPeripheralController::GetPhysicalLayout()
|
||||
{
|
||||
return physical_layout;
|
||||
|
||||
@@ -66,12 +66,13 @@ enum
|
||||
class CorsairPeripheralController
|
||||
{
|
||||
public:
|
||||
CorsairPeripheralController(hid_device* dev_handle);
|
||||
CorsairPeripheralController(hid_device* dev_handle, const char* path);
|
||||
~CorsairPeripheralController();
|
||||
|
||||
int GetLogicalLayout();
|
||||
int GetPhysicalLayout();
|
||||
device_type GetDeviceType();
|
||||
std::string GetDeviceLocation();
|
||||
std::string GetFirmwareString();
|
||||
|
||||
void SetLEDs(std::vector<RGBColor> colors);
|
||||
@@ -84,6 +85,7 @@ private:
|
||||
hid_device* dev;
|
||||
|
||||
std::string firmware_version;
|
||||
std::string location;
|
||||
device_type type;
|
||||
int physical_layout; //ANSI, ISO, etc.
|
||||
int logical_layout; //Normal, K95 or K95 Platinum
|
||||
|
||||
@@ -147,7 +147,7 @@ void DetectCorsairPeripheralControllers(std::vector<RGBController*>& rgb_control
|
||||
|
||||
if( dev )
|
||||
{
|
||||
CorsairPeripheralController* controller = new CorsairPeripheralController(dev);
|
||||
CorsairPeripheralController* controller = new CorsairPeripheralController(dev, info->path);
|
||||
|
||||
if(controller->GetDeviceType() != DEVICE_TYPE_UNKNOWN)
|
||||
{
|
||||
|
||||
@@ -559,6 +559,7 @@ RGBController_CorsairPeripheral::RGBController_CorsairPeripheral(CorsairPeripher
|
||||
description = "Corsair RGB Peripheral Device";
|
||||
type = corsair->GetDeviceType();
|
||||
version = corsair->GetFirmwareString();
|
||||
location = corsair->GetDeviceLocation();
|
||||
|
||||
physical_layout = corsair->GetPhysicalLayout();
|
||||
logical_layout = corsair->GetLogicalLayout();
|
||||
|
||||
Reference in New Issue
Block a user