diff --git a/Controllers/CorsairPeripheralV2Controller/CorsairPeripheralV2Controller.cpp b/Controllers/CorsairPeripheralV2Controller/CorsairPeripheralV2Controller.cpp index b494d03b..b6ce7186 100644 --- a/Controllers/CorsairPeripheralV2Controller/CorsairPeripheralV2Controller.cpp +++ b/Controllers/CorsairPeripheralV2Controller/CorsairPeripheralV2Controller.cpp @@ -14,21 +14,11 @@ using namespace std::chrono_literals; -CorsairPeripheralV2Controller::CorsairPeripheralV2Controller(hid_device* dev_handle, const char* path, std::string /*name*/) +CorsairPeripheralV2Controller::CorsairPeripheralV2Controller(hid_device* dev_handle, const char* path, std::string name) { dev = dev_handle; location = path; - - /*---------------------------------------------------------*\ - | Get device name from HID manufacturer and product strings | - \*---------------------------------------------------------*/ - wchar_t name_string[HID_MAX_STR]; - - hid_get_manufacturer_string(dev, name_string, HID_MAX_STR); - device_name = StringUtils::wstring_to_string(name_string); - - hid_get_product_string(dev, name_string, HID_MAX_STR); - device_name.append(" ").append(StringUtils::wstring_to_string(name_string)); + device_name = name; /*---------------------------------------------------------*\ | Get PID | diff --git a/Controllers/CorsairPeripheralV2Controller/CorsairPeripheralV2ControllerDetect.cpp b/Controllers/CorsairPeripheralV2Controller/CorsairPeripheralV2ControllerDetect.cpp index 23053a0f..e884f85b 100644 --- a/Controllers/CorsairPeripheralV2Controller/CorsairPeripheralV2ControllerDetect.cpp +++ b/Controllers/CorsairPeripheralV2Controller/CorsairPeripheralV2ControllerDetect.cpp @@ -35,15 +35,7 @@ void DetectCorsairV2HardwareControllers(hid_device_info* info, const std::string { CorsairPeripheralV2HWController* controller = new CorsairPeripheralV2HWController(dev, info->path, name); RGBController_CorsairV2HW* rgb_controller = new RGBController_CorsairV2HW(controller); - if(info->product_id == CORSAIR_SLIPSTREAM_WIRELESS_PID1 - || info->product_id == CORSAIR_SLIPSTREAM_WIRELESS_PID2) - { - rgb_controller->name = controller->GetName(); - } - else - { - rgb_controller->name = name; - } + ResourceManager::get()->RegisterRGBController(rgb_controller); } } /* DetectCorsairV2HardwareControllers() */ @@ -56,12 +48,11 @@ void DetectCorsairV2SoftwareControllers(hid_device_info* info, const std::string { CorsairPeripheralV2SWController* controller = new CorsairPeripheralV2SWController(dev, info->path, name); RGBController_CorsairV2SW* rgb_controller = new RGBController_CorsairV2SW(controller); - rgb_controller->name = name; + ResourceManager::get()->RegisterRGBController(rgb_controller); } } /* DetectCorsairV2SoftwareControllers() */ - /*-----------------------------------------------------------------------------------------------------*\ | Keyboards | \*-----------------------------------------------------------------------------------------------------*/ @@ -95,6 +86,7 @@ REGISTER_HID_DETECTOR_IP("Corsair M65 RGB Ultra Wired", DetectCorsai REGISTER_HID_DETECTOR_IP("Corsair M65 RGB Ultra Wireless (Wired)", DetectCorsairV2HardwareControllers, CORSAIR_VID, CORSAIR_M65_RGB_ULTRA_WIRELESS_PID, 1, 0xFF42); REGISTER_HID_DETECTOR_IP("Corsair Slipstream Wireless Receiver HW", DetectCorsairV2HardwareControllers, CORSAIR_VID, CORSAIR_SLIPSTREAM_WIRELESS_PID1, 1, 0xFF42); REGISTER_HID_DETECTOR_IP("Corsair Slipstream Wireless Receiver SW", DetectCorsairV2SoftwareControllers, CORSAIR_VID, CORSAIR_SLIPSTREAM_WIRELESS_PID2, 1, 0xFF42); + /*-----------------------------------------------------------------------------------------------------*\ | Mousemat | \*-----------------------------------------------------------------------------------------------------*/ diff --git a/Controllers/CorsairPeripheralV2Controller/RGBController_CorsairV2Hardware.cpp b/Controllers/CorsairPeripheralV2Controller/RGBController_CorsairV2Hardware.cpp index 82adaef4..e6d48006 100644 --- a/Controllers/CorsairPeripheralV2Controller/RGBController_CorsairV2Hardware.cpp +++ b/Controllers/CorsairPeripheralV2Controller/RGBController_CorsairV2Hardware.cpp @@ -31,8 +31,9 @@ RGBController_CorsairV2HW::RGBController_CorsairV2HW(CorsairPeripheralV2Controll controller = controller_ptr; const corsair_v2_device* corsair = controller->GetDeviceData(); + name = controller->GetName(); vendor = "Corsair"; - description = controller->GetName(); + description = "Corsair Peripheral V2 HW Device"; type = corsair->type; version = controller->GetFirmwareString(); location = controller->GetDeviceLocation(); diff --git a/Controllers/CorsairPeripheralV2Controller/RGBController_CorsairV2Software.cpp b/Controllers/CorsairPeripheralV2Controller/RGBController_CorsairV2Software.cpp index 640bfd37..8d6c5865 100644 --- a/Controllers/CorsairPeripheralV2Controller/RGBController_CorsairV2Software.cpp +++ b/Controllers/CorsairPeripheralV2Controller/RGBController_CorsairV2Software.cpp @@ -31,8 +31,9 @@ RGBController_CorsairV2SW::RGBController_CorsairV2SW(CorsairPeripheralV2Controll controller = controller_ptr; const corsair_v2_device* corsair = controller->GetDeviceData(); + name = controller->GetName(); vendor = "Corsair"; - description = controller->GetName(); + description = "Corsair Peripheral V2 SW Device"; type = corsair->type; version = controller->GetFirmwareString(); location = controller->GetDeviceLocation();