From c8da008b93c2890926bbb78e6e43728769374bfb Mon Sep 17 00:00:00 2001 From: Adam Honse Date: Fri, 2 Oct 2020 21:02:32 -0500 Subject: [PATCH] Use HID path for Location on Aorus CPU Cooler controller --- .../AorusCPUCoolerController/ATC800Controller.cpp | 10 ++++++++-- .../AorusCPUCoolerController/ATC800Controller.h | 5 ++++- .../AorusCPUCoolerControllerDetect.cpp | 2 +- .../RGBController_AorusATC800.cpp | 1 + 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Controllers/AorusCPUCoolerController/ATC800Controller.cpp b/Controllers/AorusCPUCoolerController/ATC800Controller.cpp index 32a2a704b..e201002cc 100644 --- a/Controllers/AorusCPUCoolerController/ATC800Controller.cpp +++ b/Controllers/AorusCPUCoolerController/ATC800Controller.cpp @@ -11,9 +11,10 @@ #include -ATC800Controller::ATC800Controller(hid_device* dev_handle) +ATC800Controller::ATC800Controller(hid_device* dev_handle, const char* path) { - dev = dev_handle; + dev = dev_handle; + location = path; } ATC800Controller::~ATC800Controller() @@ -21,6 +22,11 @@ ATC800Controller::~ATC800Controller() hid_close(dev); } +std::string ATC800Controller::GetDeviceLocation() +{ + return(location); +} + void ATC800Controller::SendCoolerMode ( unsigned char mode, diff --git a/Controllers/AorusCPUCoolerController/ATC800Controller.h b/Controllers/AorusCPUCoolerController/ATC800Controller.h index f796c55d0..1b279b8f5 100644 --- a/Controllers/AorusCPUCoolerController/ATC800Controller.h +++ b/Controllers/AorusCPUCoolerController/ATC800Controller.h @@ -41,9 +41,11 @@ enum class ATC800Controller { public: - ATC800Controller(hid_device* dev_handle); + ATC800Controller(hid_device* dev_handle, const char* path); ~ATC800Controller(); + std::string GetDeviceLocation(); + void SendCoolerMode ( unsigned char mode, @@ -56,4 +58,5 @@ public: private: hid_device* dev; + std::string location; }; diff --git a/Controllers/AorusCPUCoolerController/AorusCPUCoolerControllerDetect.cpp b/Controllers/AorusCPUCoolerController/AorusCPUCoolerControllerDetect.cpp index dac2e98c6..19fd941b9 100644 --- a/Controllers/AorusCPUCoolerController/AorusCPUCoolerControllerDetect.cpp +++ b/Controllers/AorusCPUCoolerController/AorusCPUCoolerControllerDetect.cpp @@ -67,7 +67,7 @@ void DetectAorusCPUCoolerControllers(std::vector& rgb_controller { case ATC_800_CONTROLLER_PID: { - ATC800Controller* controller = new ATC800Controller(dev); + ATC800Controller* controller = new ATC800Controller(dev, info->path); RGBController_AorusATC800* rgb_controller = new RGBController_AorusATC800(controller); diff --git a/Controllers/AorusCPUCoolerController/RGBController_AorusATC800.cpp b/Controllers/AorusCPUCoolerController/RGBController_AorusATC800.cpp index 77a458f69..141e44a97 100644 --- a/Controllers/AorusCPUCoolerController/RGBController_AorusATC800.cpp +++ b/Controllers/AorusCPUCoolerController/RGBController_AorusATC800.cpp @@ -16,6 +16,7 @@ RGBController_AorusATC800::RGBController_AorusATC800(ATC800Controller* cooler_pt name = "Aorus ATC800 CPU Cooler"; type = DEVICE_TYPE_COOLER; description = "Aorus ATC800 CPU Cooler"; + location = cooler->GetDeviceLocation(); mode Static; Static.name = "Static";