Skip to content

Commit 3e62c91

Browse files
Add location to Polychrome controller
1 parent 9be25d1 commit 3e62c91

3 files changed

Lines changed: 12 additions & 0 deletions

File tree

Controllers/PolychromeController/PolychromeController.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,16 @@ unsigned int PolychromeController::GetASRockType()
6262
return(asrock_type);
6363
}
6464

65+
std::string PolychromeController::GetDeviceLocation()
66+
{
67+
std::string return_string(bus->device_name);
68+
char addr[5];
69+
snprintf(addr, 5, "0x%02X", dev);
70+
return_string.append(", address ");
71+
return_string.append(addr);
72+
return(return_string);
73+
}
74+
6575
std::string PolychromeController::GetDeviceName()
6676
{
6777
return(device_name);

Controllers/PolychromeController/PolychromeController.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ class PolychromeController
105105
PolychromeController(i2c_smbus_interface* bus, polychrome_dev_id dev);
106106
~PolychromeController();
107107

108+
std::string GetDeviceLocation();
108109
std::string GetDeviceName();
109110
std::string GetFirmwareVersion();
110111
unsigned int GetMode();

RGBController/RGBController_Polychrome.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ RGBController_Polychrome::RGBController_Polychrome(PolychromeController* polychr
4040
version = polychrome->GetFirmwareVersion();
4141
type = DEVICE_TYPE_MOTHERBOARD;
4242
description = "ASRock ASR LED/Polychrome Device";
43+
location = polychrome->GetDeviceLocation();
4344

4445
switch(polychrome->GetASRockType())
4546
{

0 commit comments

Comments
 (0)