From 7d0db424ec9c4a1fe75f97a8fe1390f2f6db6dc8 Mon Sep 17 00:00:00 2001 From: Adam Honse Date: Fri, 8 Aug 2025 11:35:21 -0500 Subject: [PATCH] Store name in GigabyteAorusCPUCoolerController to avoid setting it in detector --- .../ATC800Controller.cpp | 8 +++++++- .../ATC800Controller.h | 8 +++++--- .../GigabyteAorusCPUCoolerControllerDetect.cpp | 3 +-- .../RGBController_AorusATC800.cpp | 14 +++++++------- 4 files changed, 20 insertions(+), 13 deletions(-) diff --git a/Controllers/GigabyteAorusCPUCoolerController/ATC800Controller.cpp b/Controllers/GigabyteAorusCPUCoolerController/ATC800Controller.cpp index 2d97b53c..ea9fa281 100644 --- a/Controllers/GigabyteAorusCPUCoolerController/ATC800Controller.cpp +++ b/Controllers/GigabyteAorusCPUCoolerController/ATC800Controller.cpp @@ -13,10 +13,11 @@ #include "ATC800Controller.h" #include "StringUtils.h" -ATC800Controller::ATC800Controller(hid_device* dev_handle, const char* path) +ATC800Controller::ATC800Controller(hid_device* dev_handle, const char* path, std::string dev_name) { dev = dev_handle; location = path; + name = dev_name; } ATC800Controller::~ATC800Controller() @@ -29,6 +30,11 @@ std::string ATC800Controller::GetDeviceLocation() return("HID: " + location); } +std::string ATC800Controller::GetNameString() +{ + return(name); +} + std::string ATC800Controller::GetSerialString() { wchar_t serial_string[128]; diff --git a/Controllers/GigabyteAorusCPUCoolerController/ATC800Controller.h b/Controllers/GigabyteAorusCPUCoolerController/ATC800Controller.h index db2dcaec..8b6746c9 100644 --- a/Controllers/GigabyteAorusCPUCoolerController/ATC800Controller.h +++ b/Controllers/GigabyteAorusCPUCoolerController/ATC800Controller.h @@ -61,10 +61,11 @@ enum class ATC800Controller { public: - ATC800Controller(hid_device* dev_handle, const char* path); + ATC800Controller(hid_device* dev_handle, const char* path, std::string name); ~ATC800Controller(); std::string GetDeviceLocation(); + std::string GetNameString(); std::string GetSerialString(); void DisableTempRPMIndicator(); @@ -75,6 +76,7 @@ public: void SendCoolerMode(uint8_t zone, uint8_t mode, aorus_atc800_mode_config zone_config); private: - hid_device* dev; - std::string location; + hid_device* dev; + std::string location; + std::string name; }; diff --git a/Controllers/GigabyteAorusCPUCoolerController/GigabyteAorusCPUCoolerControllerDetect.cpp b/Controllers/GigabyteAorusCPUCoolerController/GigabyteAorusCPUCoolerControllerDetect.cpp index b0cf73fc..559d23de 100644 --- a/Controllers/GigabyteAorusCPUCoolerController/GigabyteAorusCPUCoolerControllerDetect.cpp +++ b/Controllers/GigabyteAorusCPUCoolerController/GigabyteAorusCPUCoolerControllerDetect.cpp @@ -36,9 +36,8 @@ void DetectGigabyteAorusCPUCoolerControllers(hid_device_info* info, const std::s if(dev) { - ATC800Controller* controller = new ATC800Controller(dev, info->path); + ATC800Controller* controller = new ATC800Controller(dev, info->path, name); RGBController_AorusATC800* rgb_controller = new RGBController_AorusATC800(controller); - rgb_controller->name = name; ResourceManager::get()->RegisterRGBController(rgb_controller); } diff --git a/Controllers/GigabyteAorusCPUCoolerController/RGBController_AorusATC800.cpp b/Controllers/GigabyteAorusCPUCoolerController/RGBController_AorusATC800.cpp index 11147235..a812840f 100644 --- a/Controllers/GigabyteAorusCPUCoolerController/RGBController_AorusATC800.cpp +++ b/Controllers/GigabyteAorusCPUCoolerController/RGBController_AorusATC800.cpp @@ -24,14 +24,14 @@ RGBController_AorusATC800::RGBController_AorusATC800(ATC800Controller* controller_ptr) { - controller = controller_ptr; + controller = controller_ptr; - name = "Aorus ATC800 CPU Cooler"; - vendor = "Gigabyte"; - type = DEVICE_TYPE_COOLER; - description = "Aorus ATC800 CPU Cooler"; - location = controller->GetDeviceLocation(); - serial = controller->GetSerialString(); + name = controller->GetNameString(); + vendor = "Gigabyte"; + type = DEVICE_TYPE_COOLER; + description = "Aorus ATC800 CPU Cooler Device"; + location = controller->GetDeviceLocation(); + serial = controller->GetSerialString(); mode Custom; Custom.name = "Custom";