Use HID path for Location on Aorus CPU Cooler controller

This commit is contained in:
Adam Honse
2020-10-02 21:02:32 -05:00
parent 4df557391a
commit c8da008b93
4 changed files with 14 additions and 4 deletions

View File

@@ -11,9 +11,10 @@
#include <cstring>
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,

View File

@@ -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;
};

View File

@@ -67,7 +67,7 @@ void DetectAorusCPUCoolerControllers(std::vector<RGBController*>& 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);

View File

@@ -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";