Add location to Polychrome controller

This commit is contained in:
Adam Honse 2020-09-06 12:44:34 -05:00
parent 9be25d1ca4
commit 3e62c91ed3
3 changed files with 12 additions and 0 deletions

View file

@ -62,6 +62,16 @@ unsigned int PolychromeController::GetASRockType()
return(asrock_type);
}
std::string PolychromeController::GetDeviceLocation()
{
std::string return_string(bus->device_name);
char addr[5];
snprintf(addr, 5, "0x%02X", dev);
return_string.append(", address ");
return_string.append(addr);
return(return_string);
}
std::string PolychromeController::GetDeviceName()
{
return(device_name);

View file

@ -105,6 +105,7 @@ public:
PolychromeController(i2c_smbus_interface* bus, polychrome_dev_id dev);
~PolychromeController();
std::string GetDeviceLocation();
std::string GetDeviceName();
std::string GetFirmwareVersion();
unsigned int GetMode();

View file

@ -40,6 +40,7 @@ RGBController_Polychrome::RGBController_Polychrome(PolychromeController* polychr
version = polychrome->GetFirmwareVersion();
type = DEVICE_TYPE_MOTHERBOARD;
description = "ASRock ASR LED/Polychrome Device";
location = polychrome->GetDeviceLocation();
switch(polychrome->GetASRockType())
{